Francesco Romani has uploaded a new change for review. Change subject: pep8: fix pep8 1.5.4/1.5.5 ......................................................................
pep8: fix pep8 1.5.4/1.5.5 pep8 1.5.4/1.5.5 is even more strict than pep8 1.5. This patch fixes all the warnings found by pep8 1.5.5. Change-Id: I34a389df601f24292cd96f48dd8640408ea1da66 Signed-off-by: Francesco Romani <from...@redhat.com> --- M client/vdsClient.py M tests/functional/storageTests.py M tests/miscTests.py M vds_bootstrap/miniyum.py M vdsm/dmidecodeUtil.py M vdsm/gluster/hooks.py 6 files changed, 27 insertions(+), 27 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/64/26764/1 diff --git a/client/vdsClient.py b/client/vdsClient.py index 9764ea5..e67f330 100644 --- a/client/vdsClient.py +++ b/client/vdsClient.py @@ -182,7 +182,7 @@ elif param == 'guestNumaNodes': guestNumaNodes.append(self._parseDriveSpec(value)) elif param.startswith('custom_'): - if not 'custom' in params: + if 'custom' not in params: params['custom'] = {} params['custom'][param[7:]] = value else: @@ -323,10 +323,10 @@ status = conf['status'] if allStats[vmId].get('monitorResponse') == '-1': status += '*' - print ("%-36s %6s %-20s %-20s %-20s" % - (vmId, conf.get('pid', 'none'), - conf.get('vmName', '<< NO NAME >>'), - status, allStats[vmId].get('guestIPs', ''))) + print("%-36s %6s %-20s %-20s %-20s" % + (vmId, conf.get('pid', 'none'), + conf.get('vmName', '<< NO NAME >>'), + status, allStats[vmId].get('guestIPs', ''))) elif view == 'ids': print conf['vmId'] @@ -420,8 +420,8 @@ vmId = args[0] response = self.s.migrateStatus(vmId) if not response['status']['code']: - print (response['status']['message'] + - ' ' + str(response['progress']) + '%') + print(response['status']['message'] + + ' ' + str(response['progress']) + '%') else: print response['status']['message'] sys.exit(response['status']['code']) @@ -1093,7 +1093,7 @@ for entry in volumes['uuidlist']: message = entry + ' : ' res = self.s.getVolumeInfo(sdUUID, spUUID, imgUUID, entry) - if not 'info' in res: + if 'info' not in res: print 'ERROR:', entry, ':', res continue info = res['info'] @@ -1543,14 +1543,14 @@ spec = spec[1:] while True: - if not spec or not '}' in spec: + if not spec or '}' not in spec: raise Exception("nested spec not terminated " "with '}' in '%s'" % spec) if spec[0] == '}': return d, spec[1:] # Split into first name + the rest - if not ':' in spec: + if ':' not in spec: raise Exception("missing name value separator " "':' in '%s'" % spec) name, spec = spec.split(":", 1) @@ -1665,8 +1665,8 @@ status = "OK" if res["imagestatus"]: status = "ERROR" - print ("Image %s status %s: %s (%s)" % - (imgUUID, status, res["message"], res["imagestatus"])) + print("Image %s status %s: %s (%s)" % + (imgUUID, status, res["message"], res["imagestatus"])) if "badvols" in res: for v, err in res["badvols"].iteritems(): print "\tVolume %s is bad: %s" % (v, err) @@ -1676,8 +1676,8 @@ status = "OK" if res["domainstatus"]: status = "ERROR" - print ("Domain %s status %s: %s (%s)" % - (sdUUID, status, res["message"], res["domainstatus"])) + print("Domain %s status %s: %s (%s)" % + (sdUUID, status, res["message"], res["domainstatus"])) if "badimages" in res: for i in res["badimages"]: print "\tImage %s is bad" % (i) @@ -1688,8 +1688,8 @@ status = "OK" if res["poolstatus"]: status = "ERROR" - print ("Pool %s status %s: %s (%s)" % - (spUUID, status, res["message"], res["poolstatus"])) + print("Pool %s status %s: %s (%s)" % + (spUUID, status, res["message"], res["poolstatus"])) if "masterdomain": print "\tMaster domain is %s" % res["masterdomain"] if "spmhost": diff --git a/tests/functional/storageTests.py b/tests/functional/storageTests.py index 87de040..fe56939 100644 --- a/tests/functional/storageTests.py +++ b/tests/functional/storageTests.py @@ -370,7 +370,7 @@ class IscsiServer(BackendServer): def __init__(self, vdsmServer, asserts): # check if the system supports configuring iSCSI target - if not "rtslib" in globals().keys(): + if "rtslib" not in globals().keys(): raise SkipTest("python-rtslib is not installed.") cmd = [_modprobe.cmd, "iscsi_target_mod"] @@ -499,7 +499,7 @@ # Check if gluster volume is created & started glusterVolName = spec.split(':')[1] - if not glusterVolName in self.glusterVolInfo['volumes']: + if glusterVolName not in self.glusterVolInfo['volumes']: raise SkipTest("Test volume %s not found. Pls create it " "and start it" % glusterVolName) diff --git a/tests/miscTests.py b/tests/miscTests.py index ca00ec7..69cf690 100644 --- a/tests/miscTests.py +++ b/tests/miscTests.py @@ -1169,7 +1169,7 @@ try: os.write(pipe, longStr) except OSError as e: - if not e.errno in (errno.EINTR, errno.EAGAIN): + if e.errno not in (errno.EINTR, errno.EAGAIN): raise myPipe, hisPipe = os.pipe() diff --git a/vds_bootstrap/miniyum.py b/vds_bootstrap/miniyum.py index eb2e4f5..531c0a1 100755 --- a/vds_bootstrap/miniyum.py +++ b/vds_bootstrap/miniyum.py @@ -477,7 +477,7 @@ if self.buildTransaction(): self.processTransaction() - if not 'selinux' in globals(): + if 'selinux' not in globals(): selinux = __import__('selinux', globals(), locals(), [], -1) if selinux.is_selinux_enabled() and "MINIYUM_2ND" not in os.environ: env = os.environ.copy() diff --git a/vdsm/dmidecodeUtil.py b/vdsm/dmidecodeUtil.py index eb8d834..54fbadb 100644 --- a/vdsm/dmidecodeUtil.py +++ b/vdsm/dmidecodeUtil.py @@ -90,10 +90,10 @@ ================== {memory} """.format( - system=formatData(d['system']), - bios=formatData(d['bios']), - cache=formatData(d['cache']), - processor=formatData(d['processor']), - chassis=formatData(d['chassis']), - memory=formatData(d['memory'])) + system=formatData(d['system']), + bios=formatData(d['bios']), + cache=formatData(d['cache']), + processor=formatData(d['processor']), + chassis=formatData(d['chassis']), + memory=formatData(d['memory'])) ) diff --git a/vdsm/gluster/hooks.py b/vdsm/gluster/hooks.py index 75c8470..9a7904f 100644 --- a/vdsm/gluster/hooks.py +++ b/vdsm/gluster/hooks.py @@ -213,7 +213,7 @@ hookLevel.lower(), hookName) hookStat = [os.path.exists(enabledFile), os.path.exists(disabledFile)] if update: - if not True in hookStat: + if True not in hookStat: raise ge.GlusterHookNotFoundException(glusterCmd, hookLevel, hookName) else: -- To view, visit http://gerrit.ovirt.org/26764 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34a389df601f24292cd96f48dd8640408ea1da66 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <from...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches