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

Fix typos. Code Inspection for pep8 conventions

This commit is contained in:
catborise 2019-10-30 11:05:50 +03:00
parent 568ff92449
commit f3f4f0afe8
6 changed files with 37 additions and 30 deletions

View file

@ -318,9 +318,9 @@ class IPint(object):
(self._ipversion == 6 and self._prefixlen == 128):
if self.NoPrefixForSingleIp:
want = 0
if want == None:
if want is None:
want = self.WantPrefixLen
if want == None:
if want is None:
want = 1
if want:
if want == 2:
@ -354,7 +354,7 @@ class IPint(object):
"""
bits = _ipVersionToLen(self._ipversion)
if self.WantPrefixLen == None and wantprefixlen == None:
if self.WantPrefixLen is None and wantprefixlen is None:
wantprefixlen = 0
ret = _intToBin(self.ip)
return '0' * (bits - len(ret)) + ret + self._printPrefix(wantprefixlen)
@ -370,7 +370,7 @@ class IPint(object):
'ffff:ffff:ffff:ffff:ffff:f:f:fffc/127'
"""
if self.WantPrefixLen == None and wantprefixlen == None:
if self.WantPrefixLen is None and wantprefixlen is None:
wantprefixlen = 1
if self._ipversion == 4:
@ -413,7 +413,7 @@ class IPint(object):
2001:658:22a:cafe:200:0:0:1
"""
if self.WantPrefixLen == None and wantprefixlen == None:
if self.WantPrefixLen is None and wantprefixlen is None:
wantprefixlen = 1
if self._ipversion == 4:
@ -434,7 +434,7 @@ class IPint(object):
2001:0658:022a:cafe:0200:0000:0000:0001
"""
if self.WantPrefixLen == None and wantprefixlen == None:
if self.WantPrefixLen is None and wantprefixlen is None:
wantprefixlen = 1
return intToIp(self.ip, self._ipversion) + self._printPrefix(wantprefixlen)
@ -448,7 +448,7 @@ class IPint(object):
0x20010658022acafe0200000000000001
"""
if self.WantPrefixLen == None and wantprefixlen == None:
if self.WantPrefixLen is None and wantprefixlen is None:
wantprefixlen = 0
x = '0x%x' % self.ip
@ -463,7 +463,7 @@ class IPint(object):
42540616829182469433547762482097946625
"""
if self.WantPrefixLen == None and wantprefixlen == None:
if self.WantPrefixLen is None and wantprefixlen is None:
wantprefixlen = 0
x = '%d' % self.ip

View file

@ -247,7 +247,7 @@ class wvmInstance(wvmConnect):
def get_disk_devices(self):
def disks(doc):
result = []
dev = volume = storage = src_file = None
dev = volume = storage = src_file = bus = None
disk_format = used_size = disk_size = disk_cache = None
for disk in doc.xpath('/domain/devices/disk'):
@ -288,7 +288,7 @@ class wvmInstance(wvmConnect):
def get_media_devices(self):
def disks(doc):
result = []
dev = volume = storage = None
dev = volume = storage = bus = None
src_file = None
for media in doc.xpath('/domain/devices/disk'):
device = media.xpath('@device')[0]
@ -341,6 +341,7 @@ class wvmInstance(wvmConnect):
def get_bootorder(self):
boot_order = {}
type = target = None
tree = ElementTree.fromstring(self._XMLDesc(0))
os = tree.find('os')
boot = os.findall('boot')
@ -363,7 +364,7 @@ class wvmInstance(wvmConnect):
devices = tree.find('devices')
for dev in devices:
dev_target = dev_type = dev_device = dev_alias = None
dev_target = None
boot_dev = dev.find('boot')
if boot_dev is not None:
idx = boot_dev.get('order')
@ -439,6 +440,7 @@ class wvmInstance(wvmConnect):
disk.insert(2, src_media)
return True
vol = None
storages = self.get_storages(only_actives=True)
for storage in storages:
stg = self.get_storage(storage)