Make pylint happy
This commit is contained in:
parent
3dd92faa0e
commit
5fa75d73be
@ -361,7 +361,7 @@ class DeviceCollection:
|
|||||||
for dev, options in devices:
|
for dev, options in devices:
|
||||||
if dev in self._set and not persistent:
|
if dev in self._set and not persistent:
|
||||||
continue
|
continue
|
||||||
elif dev in self._set:
|
if dev in self._set:
|
||||||
result.add(self._set.get(dev))
|
result.add(self._set.get(dev))
|
||||||
elif dev not in self._set and persistent:
|
elif dev not in self._set and persistent:
|
||||||
continue
|
continue
|
||||||
|
@ -565,10 +565,9 @@ class Firewall:
|
|||||||
if rule.expire:
|
if rule.expire:
|
||||||
if rule.expire and rule.expire.expired:
|
if rule.expire and rule.expire.expired:
|
||||||
continue
|
continue
|
||||||
else:
|
if nearest_expire is None or rule.expire.datetime < \
|
||||||
if nearest_expire is None or rule.expire.datetime < \
|
nearest_expire:
|
||||||
nearest_expire:
|
nearest_expire = rule.expire.datetime
|
||||||
nearest_expire = rule.expire.datetime
|
|
||||||
xml_rule = lxml.etree.Element('rule')
|
xml_rule = lxml.etree.Element('rule')
|
||||||
xml_rule.append(rule.xml_properties())
|
xml_rule.append(rule.xml_properties())
|
||||||
xml_rules.append(xml_rule)
|
xml_rules.append(xml_rule)
|
||||||
|
@ -695,7 +695,7 @@ class VolumesCollection:
|
|||||||
|
|
||||||
def values(self):
|
def values(self):
|
||||||
''' Return list of Volumes'''
|
''' Return list of Volumes'''
|
||||||
return [vol for vol in self]
|
return list(self)
|
||||||
|
|
||||||
|
|
||||||
class Pool:
|
class Pool:
|
||||||
|
@ -461,7 +461,8 @@ def _copy_file(src, dst):
|
|||||||
return True
|
return True
|
||||||
LOGGER.info('Copying file: %s -> %s', src, tmp_io.name)
|
LOGGER.info('Copying file: %s -> %s', src, tmp_io.name)
|
||||||
cmd = 'cp', '--sparse=always', src, tmp_io.name
|
cmd = 'cp', '--sparse=always', src, tmp_io.name
|
||||||
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||||
|
check=False)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise qubes.storage.StoragePoolException(str(p))
|
raise qubes.storage.StoragePoolException(str(p))
|
||||||
return False
|
return False
|
||||||
|
@ -2070,7 +2070,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
# '/qubes-netvm-network' value is only checked for being non empty
|
# '/qubes-netvm-network' value is only checked for being non empty
|
||||||
self.untrusted_qdb.write('/qubes-netvm-network', str(self.gateway))
|
self.untrusted_qdb.write('/qubes-netvm-network', str(self.gateway))
|
||||||
self.untrusted_qdb.write('/qubes-netvm-gateway', str(self.gateway))
|
self.untrusted_qdb.write('/qubes-netvm-gateway', str(self.gateway))
|
||||||
if self.gateway6:
|
if self.gateway6: # pylint: disable=using-constant-test
|
||||||
self.untrusted_qdb.write('/qubes-netvm-gateway6',
|
self.untrusted_qdb.write('/qubes-netvm-gateway6',
|
||||||
str(self.gateway6))
|
str(self.gateway6))
|
||||||
self.untrusted_qdb.write('/qubes-netvm-netmask', str(self.netmask))
|
self.untrusted_qdb.write('/qubes-netvm-netmask', str(self.netmask))
|
||||||
@ -2089,9 +2089,9 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
for i, addr in zip(('primary', 'secondary'), self.dns):
|
for i, addr in zip(('primary', 'secondary'), self.dns):
|
||||||
self.untrusted_qdb.write('/qubes-{}-dns'.format(i), str(addr))
|
self.untrusted_qdb.write('/qubes-{}-dns'.format(i), str(addr))
|
||||||
|
|
||||||
if self.visible_ip6:
|
if self.visible_ip6: # pylint: disable=using-constant-test
|
||||||
self.untrusted_qdb.write('/qubes-ip6', str(self.visible_ip6))
|
self.untrusted_qdb.write('/qubes-ip6', str(self.visible_ip6))
|
||||||
if self.visible_gateway6:
|
if self.visible_gateway6: # pylint: disable=using-constant-test
|
||||||
self.untrusted_qdb.write('/qubes-gateway6',
|
self.untrusted_qdb.write('/qubes-gateway6',
|
||||||
str(self.visible_gateway6))
|
str(self.visible_gateway6))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user