1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Migrate source code to python 3.7 and refine code style

This commit is contained in:
Gao Jiangmiao 2019-08-16 12:59:37 +08:00
parent 0e231a930d
commit a4d74a09a6
55 changed files with 192 additions and 306 deletions

View file

@ -2,7 +2,6 @@ import string
from vrtManager import util
from vrtManager.connection import wvmConnect
from webvirtcloud.settings import QEMU_CONSOLE_DEFAULT_TYPE
from webvirtcloud.settings import QEMU_CONSOLE_LISTEN_ADDRESSES
from webvirtcloud.settings import INSTANCE_VOLUME_DEFAULT_OWNER as default_owner
from webvirtcloud.settings import INSTANCE_VOLUME_DEFAULT_FORMAT
@ -107,7 +106,7 @@ class wvmCreate(wvmConnect):
if not pool:
storages = self.get_storages(only_actives=True)
else:
storages = [pool,]
storages = [pool]
for storage in storages:
stg = self.get_storage(storage)
if stg.info()[0] != 0:
@ -204,12 +203,13 @@ class wvmCreate(wvmConnect):
hd_disk_letters = list(string.lowercase)
sd_disk_letters = list(string.lowercase)
add_cd = True
#for image, img_type in images.items():
# for image, img_type in images.items():
for volume in images:
stg = self.get_storage_by_vol_path(volume['path'])
stg_type = util.get_xml_path(stg.XMLDesc(0), "/pool/@type")
if volume['device'] == 'cdrom': add_cd = False
if volume['device'] == 'cdrom':
add_cd = False
if stg_type == 'rbd':
ceph_user, secret_uuid, ceph_hosts = get_rbd_storage_data(stg)
@ -284,7 +284,4 @@ class wvmCreate(wvmConnect):
</devices>
</domain>""" % video
self._defineXML(xml)