Make pylint happy

This commit is contained in:
Marek Marczykowski-Górecki 2019-09-25 01:18:09 +02:00
parent 3dd92faa0e
commit 5fa75d73be
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
5 changed files with 10 additions and 10 deletions

View File

@ -361,7 +361,7 @@ class DeviceCollection:
for dev, options in devices:
if dev in self._set and not persistent:
continue
elif dev in self._set:
if dev in self._set:
result.add(self._set.get(dev))
elif dev not in self._set and persistent:
continue

View File

@ -565,10 +565,9 @@ class Firewall:
if rule.expire:
if rule.expire and rule.expire.expired:
continue
else:
if nearest_expire is None or rule.expire.datetime < \
nearest_expire:
nearest_expire = rule.expire.datetime
if nearest_expire is None or rule.expire.datetime < \
nearest_expire:
nearest_expire = rule.expire.datetime
xml_rule = lxml.etree.Element('rule')
xml_rule.append(rule.xml_properties())
xml_rules.append(xml_rule)

View File

@ -695,7 +695,7 @@ class VolumesCollection:
def values(self):
''' Return list of Volumes'''
return [vol for vol in self]
return list(self)
class Pool:

View File

@ -461,7 +461,8 @@ def _copy_file(src, dst):
return True
LOGGER.info('Copying file: %s -> %s', 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:
raise qubes.storage.StoragePoolException(str(p))
return False

View File

@ -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
self.untrusted_qdb.write('/qubes-netvm-network', 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',
str(self.gateway6))
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):
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))
if self.visible_gateway6:
if self.visible_gateway6: # pylint: disable=using-constant-test
self.untrusted_qdb.write('/qubes-gateway6',
str(self.visible_gateway6))