mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 07:35:22 +00:00
Merge branch 'master' into master
This commit is contained in:
commit
1c84f241ad
2 changed files with 11 additions and 5 deletions
|
@ -46,6 +46,7 @@ class wvmNetworks(wvmConnect):
|
||||||
"device": net_bridge,
|
"device": net_bridge,
|
||||||
"forward": net_forward
|
"forward": net_forward
|
||||||
})
|
})
|
||||||
|
|
||||||
return networks
|
return networks
|
||||||
|
|
||||||
def define_network(self, xml):
|
def define_network(self, xml):
|
||||||
|
|
|
@ -227,11 +227,18 @@ class wvmStorage(wvmConnect):
|
||||||
return self.pool.refresh(0)
|
return self.pool.refresh(0)
|
||||||
|
|
||||||
def get_volume_details(self, volname):
|
def get_volume_details(self, volname):
|
||||||
try:
|
with contextlib.suppress(Exception):
|
||||||
self.refresh()
|
self.refresh()
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
vols = self.get_volumes()
|
||||||
|
return [{"name": volname,
|
||||||
|
"size": self.get_volume_size(volname),
|
||||||
|
"allocation": self.get_volume_allocation(volname),
|
||||||
|
"type": self.get_volume_format_type(volname)} for volname in vols]
|
||||||
|
|
||||||
|
def get_volume_details(self, volname):
|
||||||
|
with contextlib.suppress(Exception):
|
||||||
|
self.refresh()
|
||||||
return {
|
return {
|
||||||
"name": volname,
|
"name": volname,
|
||||||
"size": self.get_volume_size(volname),
|
"size": self.get_volume_size(volname),
|
||||||
|
@ -239,7 +246,6 @@ class wvmStorage(wvmConnect):
|
||||||
"type": self.get_volume_format_type(volname),
|
"type": self.get_volume_format_type(volname),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def update_volumes(self):
|
def update_volumes(self):
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(Exception):
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
@ -248,7 +254,6 @@ class wvmStorage(wvmConnect):
|
||||||
"allocation": self.get_volume_allocation(volname),
|
"allocation": self.get_volume_allocation(volname),
|
||||||
"type": self.get_volume_format_type(volname)} for volname in vols]
|
"type": self.get_volume_format_type(volname)} for volname in vols]
|
||||||
|
|
||||||
|
|
||||||
def create_volume(self, name, size, vol_fmt="qcow2", metadata=False, disk_owner_uid=0, disk_owner_gid=0):
|
def create_volume(self, name, size, vol_fmt="qcow2", metadata=False, disk_owner_uid=0, disk_owner_gid=0):
|
||||||
size = int(size) * 1073741824
|
size = int(size) * 1073741824
|
||||||
storage_type = self.get_type()
|
storage_type = self.get_type()
|
||||||
|
|
Loading…
Reference in a new issue