diff --git a/lib/vdsm/network/nmstate/ovs/network.py b/lib/vdsm/network/nmstate/ovs/network.py index e83154c9a..a1737b061 100644 --- a/lib/vdsm/network/nmstate/ovs/network.py +++ b/lib/vdsm/network/nmstate/ovs/network.py @@ -205,7 +205,7 @@ def _get_persisted_ports_by_bridge(self): persisted_ports_by_bridge[bridge] = [ port for port in ports - if not port[OvsBridgeSchema.Port.NAME] in net_names + if port[OvsBridgeSchema.Port.NAME] not in net_names ] return persisted_ports_by_bridge diff --git a/lib/vdsm/storage/formatconverter.py b/lib/vdsm/storage/formatconverter.py index 0984963ee..12a4f5f34 100644 --- a/lib/vdsm/storage/formatconverter.py +++ b/lib/vdsm/storage/formatconverter.py @@ -96,7 +96,7 @@ def v3UpgradeVolumePermissions(vol): vol._setrw(True) def v3ReallocateMetadataSlot(domain, allVolumes): - if not domain.getStorageType() in sd.BLOCK_DOMAIN_TYPES: + if domain.getStorageType() not in sd.BLOCK_DOMAIN_TYPES: log.debug("The metadata reallocation check is not needed for " "domain %s", domain.sdUUID) return diff --git a/lib/vdsm/storage/sd.py b/lib/vdsm/storage/sd.py index 19078d795..0095519af 100644 --- a/lib/vdsm/storage/sd.py +++ b/lib/vdsm/storage/sd.py @@ -214,13 +214,13 @@ def packLeaseParams(lockRenewalIntervalSec, leaseTimeSec, def validateSDDeprecatedStatus(status): - if not status.capitalize() in DEPRECATED_STATUSES: + if status.capitalize() not in DEPRECATED_STATUSES: raise se.StorageDomainStatusError(status) return DEPRECATED_STATUSES[status.capitalize()] def validateSDStatus(status): - if not status.capitalize() in DOMAIN_STATUSES: + if status.capitalize() not in DOMAIN_STATUSES: raise se.StorageDomainStatusError(status) diff --git a/lib/vdsm/tool/configurators/libvirt.py b/lib/vdsm/tool/configurators/libvirt.py index 59b06c72a..6ae76f5c4 100644 --- a/lib/vdsm/tool/configurators/libvirt.py +++ b/lib/vdsm/tool/configurators/libvirt.py @@ -97,7 +97,7 @@ def isconfigured(): if not _is_hugetlbfs_1g_mounted(): ret = NO - if not _socket_unit() in _unit_requirements(_LIBVIRT_SERVICE_UNIT): + if _socket_unit() not in _unit_requirements(_LIBVIRT_SERVICE_UNIT): ret = NO if ret == MAYBE: diff --git a/tests/schemavalidation_test.py b/tests/schemavalidation_test.py index ee79802ea..923190e93 100644 --- a/tests/schemavalidation_test.py +++ b/tests/schemavalidation_test.py @@ -127,12 +127,12 @@ def _validate(self, api_mod): for marg in method_args: # verify optional arg if 'defaultvalue' in marg: - if not marg.get('name') in default_args: + if marg.get('name') not in default_args: raise AssertionError( self._prep_msg(rep, method_args, args)) continue # verify args from schema in apiobj args - if not marg.get('name') in args: + if marg.get('name') not in args: raise AssertionError( self._prep_msg(rep, method_args, args)) try: diff --git a/tests/virt/vmoperations_test.py b/tests/virt/vmoperations_test.py index f4cd3106e..b585fa092 100644 --- a/tests/virt/vmoperations_test.py +++ b/tests/virt/vmoperations_test.py @@ -77,7 +77,7 @@ class TestVmOperations(XMLTestCase): def testTimeOffsetNotPresentByDefault(self, exitCode): with fake.VM() as testvm: testvm.setDownStatus(exitCode, vmexitreason.GENERIC_ERROR) - assert not ('timeOffset' in testvm.getStats()) + assert 'timeOffset' not in testvm.getStats() @MonkeyPatch(libvirtconnection, 'get', lambda x: fake.Connection()) @permutations([[define.NORMAL], [define.ERROR]]) diff --git a/vdsm_hooks/scratchpad/before_vm_start.py b/vdsm_hooks/scratchpad/before_vm_start.py index 6a134ff37..697e07a3f 100755 --- a/vdsm_hooks/scratchpad/before_vm_start.py +++ b/vdsm_hooks/scratchpad/before_vm_start.py @@ -84,7 +84,7 @@ def add_disk(domxml, path): disks.append(d.getElementsByTagName('target')[0].getAttribute('dev')) for i in range(0, 27): - if not indexToDiskName(i) in disks: + if indexToDiskName(i) not in disks: target.setAttribute('dev', indexToDiskName(i)) break disk.appendChild(target)