1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-10-31 19:44:16 +00:00

Merge branch 'master' into master

This commit is contained in:
catborise 2022-08-22 15:34:51 +03:00 committed by GitHub
commit 1c84f241ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View file

@ -46,6 +46,7 @@ class wvmNetworks(wvmConnect):
"device": net_bridge,
"forward": net_forward
})
return networks
def define_network(self, xml):

View file

@ -227,11 +227,18 @@ class wvmStorage(wvmConnect):
return self.pool.refresh(0)
def get_volume_details(self, volname):
try:
with contextlib.suppress(Exception):
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 {
"name": volname,
"size": self.get_volume_size(volname),
@ -239,7 +246,6 @@ class wvmStorage(wvmConnect):
"type": self.get_volume_format_type(volname),
}
def update_volumes(self):
with contextlib.suppress(Exception):
self.refresh()
@ -248,7 +254,6 @@ class wvmStorage(wvmConnect):
"allocation": self.get_volume_allocation(volname),
"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):
size = int(size) * 1073741824
storage_type = self.get_type()