Skip to content

Commit

Permalink
fix_Flake8_Rules_E713
Browse files Browse the repository at this point in the history
Signed-off-by: Sergii Kuzko <[email protected]>
  • Loading branch information
Sergii Kuzko authored and tinez committed Mar 4, 2024
1 parent 49eaf70 commit 126bb0d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/vdsm/network/nmstate/ovs/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/vdsm/storage/formatconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/vdsm/storage/sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion lib/vdsm/tool/configurators/libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/schemavalidation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/virt/vmoperations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]])
Expand Down
2 changes: 1 addition & 1 deletion vdsm_hooks/scratchpad/before_vm_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 126bb0d

Please sign in to comment.