Dan Kenigsberg has uploaded a new change for review. Change subject: pep8: drop redundant trailing backslash ......................................................................
pep8: drop redundant trailing backslash Upstream pep8.py tool cries about it, and it was easy to fix automatically. Change-Id: Id702c194ecff6e231539fd88fa20188f31326948 Signed-off-by: Dan Kenigsberg <[email protected]> --- M tests/alignmentScanTests.py M tests/getAllVolumesTests.py M tests/persistentDictTests.py M tests/restTests.py M vdsm/API.py M vdsm/alignmentScan.py M vdsm/storage/hsm.py M vdsm/storage/image.py M vdsm/storage/sp.py M vdsm/storage/storage_mailbox.py M vdsm_api/process-schema.py M vdsm_cli/vdsClient.py M vdsm_reg/register-to-engine.py 13 files changed, 33 insertions(+), 33 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/8752/1 diff --git a/tests/alignmentScanTests.py b/tests/alignmentScanTests.py index 2519caf..c8aa129 100644 --- a/tests/alignmentScanTests.py +++ b/tests/alignmentScanTests.py @@ -51,7 +51,7 @@ eq_(retcode, 0) eq_(err, []) out = "\n".join(out) - assert_not_equals(out.find("/usr/bin/virt-alignment-scan: check " \ + assert_not_equals(out.find("/usr/bin/virt-alignment-scan: check " "alignment of virtual machine partitions"), -1) assert_not_equals(out.find("Usage:"), -1) assert_not_equals(out.find("Options:"), -1) diff --git a/tests/getAllVolumesTests.py b/tests/getAllVolumesTests.py index ffc12c5..db1a289 100644 --- a/tests/getAllVolumesTests.py +++ b/tests/getAllVolumesTests.py @@ -42,7 +42,7 @@ lvs_out = open(os.path.join(testDir, 'lvs_%s.out' % vgName), "r").read() for line in lvs_out.split(): - fields = [field.strip() for field in \ + fields = [field.strip() for field in line.split(storage.lvm.SEPARATOR)] lvs.append(storage.lvm.makeLV(*fields)) return lvs diff --git a/tests/persistentDictTests.py b/tests/persistentDictTests.py index 39a21d5..742ffca 100644 --- a/tests/persistentDictTests.py +++ b/tests/persistentDictTests.py @@ -67,8 +67,8 @@ try: with pd.transaction(): with pd.transaction(): - raise SpecialError("Take the Kama Sutra. How many people" \ - "died from the Kama Sutra, as opposed" \ + raise SpecialError("Take the Kama Sutra. How many people" + "died from the Kama Sutra, as opposed" "to the Bible? Who wins?") # (C) Frank Zappa except RuntimeError: diff --git a/tests/restTests.py b/tests/restTests.py index a9b8af3..e48ec64 100644 --- a/tests/restTests.py +++ b/tests/restTests.py @@ -67,7 +67,7 @@ try: return _fakeret[self.type][self.lastFunc].pop(0) except (KeyError, IndexError): - raise Exception("No API data avilable for %s.%s" % \ + raise Exception("No API data avilable for %s.%s" % (self.type, self.lastFunc)) def __getattr__(self, name): diff --git a/vdsm/API.py b/vdsm/API.py index bbc3221..bb8c1bd 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -176,7 +176,7 @@ self.log.error('Missing required parameter %s' % (param)) return {'status': {'code': errCode['MissParam'] ['status']['code'], - 'message': 'Missing required' + \ + 'message': 'Missing required' + 'parameter %s' % (param)}} try: storage.misc.validateUUID(vmParams['vmId']) @@ -359,7 +359,7 @@ except ValueError: self.log.error('Missing one of required parameters: vmId, nic') return {'status': {'code': errCode['MissParam']['status']['code'], - 'message': 'Missing one of required' + \ + 'message': 'Missing one of required' + 'parameters: vmId, nic'}} try: curVm = self._cif.vmContainer[self._UUID] @@ -375,7 +375,7 @@ except ValueError: self.log.error('Missing one of required parameters: vmId, nic') return {'status': {'code': errCode['MissParam']['status']['code'], - 'message': 'Missing one of required' + \ + 'message': 'Missing one of required' + 'parameters: vmId, nic'}} try: curVm = self._cif.vmContainer[self._UUID] @@ -391,7 +391,7 @@ except ValueError: self.log.error('Missing one of required parameters: vmId, drive') return {'status': {'code': errCode['MissParam']['status']['code'], - 'message': 'Missing one of required' + \ + 'message': 'Missing one of required' + 'parameters: vmId, drive'}} try: curVm = self._cif.vmContainer[self._UUID] @@ -407,7 +407,7 @@ except ValueError: self.log.error('Missing one of required parameters: vmId, drive') return {'status': {'code': errCode['MissParam']['status']['code'], - 'message': 'Missing one of required' + \ + 'message': 'Missing one of required' + 'parameters: vmId, drive'}} try: curVm = self._cif.vmContainer[self._UUID] @@ -1120,7 +1120,7 @@ Doesn't survive a restart """ - logging.getLogger('clientIF.setLogLevel').info('Setting loglevel' + \ + logging.getLogger('clientIF.setLogLevel').info('Setting loglevel' + 'to %s' % level) handlers = logging.getLogger().handlers [fileHandler] = [h for h in handlers if @@ -1205,7 +1205,7 @@ if vlan or bond or nics: # Backwards compatibility - self.log.warn('Specifying vlan,' + \ + self.log.warn('Specifying vlan,' + 'bond or nics to delNetwork is deprecated') _netinfo = netinfo.NetInfo() try: @@ -1215,7 +1215,7 @@ configNetwork.validateVlanId(vlan) if nics and bond and set(nics) != \ set(_netinfo.bondings[bond]["slaves"]): - self.log.error('delNetwork: not all nics specified' + \ + self.log.error('delNetwork: not all nics specified' + 'are enslaved (%s != %s)' % (nics, _netinfo.bondings[bond]["slaves"])) diff --git a/vdsm/alignmentScan.py b/vdsm/alignmentScan.py index 6a6b984..3a76654 100644 --- a/vdsm/alignmentScan.py +++ b/vdsm/alignmentScan.py @@ -43,7 +43,7 @@ if retcode == 0: pass elif retcode == 1: - raise VirtAlignError("An error scanning the disk image " \ + raise VirtAlignError("An error scanning the disk image " "or guest:\n%s" % err) elif retcode == 2: # Successful exit, some partitions have alignment < 64K @@ -54,7 +54,7 @@ # which can result in poor performance on most hypervisors. pass else: - raise VirtAlignError("Unexpected return code from " \ + raise VirtAlignError("Unexpected return code from " "virt-alignment-scan: %d" % retcode) out_list = [] for line in out: diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 711354b..c6d6872 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -744,8 +744,8 @@ ioOpTimeoutSec=ioOpTimeoutSec, leaseRetries=leaseRetries) vars.task.setDefaultException( - se.StoragePoolCreationError("spUUID=%s, " \ - "poolName=%s, masterDom=%s, domList=%s, masterVersion=%s, " \ + se.StoragePoolCreationError("spUUID=%s, " + "poolName=%s, masterDom=%s, domList=%s, masterVersion=%s, " "safelease params: (%s)" % ( spUUID, poolName, masterDom, domList, masterVersion, safeLease @@ -806,7 +806,7 @@ :raises: :exc:`storage_exception.ConnotConnectMultiplePools` when storage pool is not connected to the system. """ vars.task.setDefaultException( - se.StoragePoolConnectionError("spUUID=%s, msdUUID=%s, masterVersion=%s, " \ + se.StoragePoolConnectionError("spUUID=%s, msdUUID=%s, masterVersion=%s, " "hostID=%s, scsiKey=%s" % (spUUID, msdUUID, masterVersion, hostID, scsiKey))) return self._connectStoragePool(spUUID, hostID, scsiKey, msdUUID, masterVersion, options) @@ -1704,8 +1704,8 @@ lvm.createVG(vgname, devices, blockSD.STORAGE_UNREADY_DOMAIN_TAG, metadataSize=blockSD.VG_METADATASIZE, - force=(force == True) or \ - (type(force) == type("") and \ + force=(force == True) or + (type(force) == type("") and (force.capitalize() == "True"))) return dict(uuid=lvm.getVG(vgname).uuid) diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py index e86d94c..b1f482a 100644 --- a/vdsm/storage/image.py +++ b/vdsm/storage/image.py @@ -596,7 +596,7 @@ """ Move/Copy image between storage domains within same storage pool """ - self.log.info("srcSdUUID=%s dstSdUUID=%s "\ + self.log.info("srcSdUUID=%s dstSdUUID=%s " "imgUUID=%s vmUUID=%s op=%s force=%s postZero=%s", srcSdUUID, dstSdUUID, imgUUID, vmUUID, OP_TYPES[op], str(force), str(postZero)) @@ -699,8 +699,8 @@ Create new template/volume from VM. Do it by collapse and copy the whole chain (baseVolUUID->srcVolUUID) """ - self.log.info("sdUUID=%s vmUUID=%s "\ - "srcImgUUID=%s srcVolUUID=%s dstImgUUID=%s dstVolUUID=%s dstSdUUID=%s volType=%s"\ + self.log.info("sdUUID=%s vmUUID=%s " + "srcImgUUID=%s srcVolUUID=%s dstImgUUID=%s dstVolUUID=%s dstSdUUID=%s volType=%s" " volFormat=%s preallocate=%s force=%s postZero=%s", sdUUID, vmUUID, srcImgUUID, srcVolUUID, dstImgUUID, dstVolUUID, dstSdUUID, volType, volume.type2name(volFormat), volume.type2name(preallocate), str(force), str(postZero)) @@ -1058,7 +1058,7 @@ 'successor' - source volume UUID 'ancestor' - destination volume UUID """ - self.log.info("sdUUID=%s vmUUID=%s"\ + self.log.info("sdUUID=%s vmUUID=%s" " imgUUID=%s ancestor=%s successor=%s postZero=%s", sdUUID, vmUUID, imgUUID, ancestor, successor, str(postZero)) diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py index 78fbe66..a76a74c 100644 --- a/vdsm/storage/sp.py +++ b/vdsm/storage/sp.py @@ -1571,8 +1571,8 @@ @unsecured def getDomains(self, activeOnly=False): - return dict((sdUUID, status) \ - for sdUUID, status in self.getMetaParam(PMDK_DOMAINS).iteritems() \ + return dict((sdUUID, status) + for sdUUID, status in self.getMetaParam(PMDK_DOMAINS).iteritems() if not activeOnly or status == sd.DOM_ACTIVE_STATUS) def checkBackupDomain(self): @@ -1804,7 +1804,7 @@ imgsByVol.iteritems() if len(vol.imgs) > 1) if len(ts) != 1: raise se.ImageValidationError("Image points to multiple" - "templates %s in %s from %s" % \ + "templates %s in %s from %s" % (ts, imgsByVol, allVols)) # TODO: Lock the template, reload allVols. # template = ts[0] = [(tName, tImgs)] diff --git a/vdsm/storage/storage_mailbox.py b/vdsm/storage/storage_mailbox.py index b0e3360..c537883 100644 --- a/vdsm/storage/storage_mailbox.py +++ b/vdsm/storage/storage_mailbox.py @@ -117,7 +117,7 @@ # Sanity check - Make sure reply is for current message sizeOffset = 5 + 2 * PACKED_UUID_SIZE if (self.payload[0:sizeOffset] != reply[0:sizeOffset]): - self.log.error("SPM_Extend_Message: Reply message volume data (domainID + volumeID)"\ + self.log.error("SPM_Extend_Message: Reply message volume data (domainID + volumeID)" " differs from request message, reply : %s, orig: %s", reply, self.payload) raise RuntimeError('Incorrect reply') #if (self.payload[sizeOffset:sizeOffset + PACKED_UUID_SIZE] > reply[sizeOffset:sizeOffset + PACKED_UUID_SIZE]): @@ -314,7 +314,7 @@ self.log.error("HSM_MailMonitor: exception caught while running msg callback, for message: %s, callback function: %s", repr(msg.payload), msg.callback, exc_info=True) except RuntimeError, e: - self.log.error("HSM_MailMonitor: exception: %s caught while checking reply for message: %s, reply: %s", \ + self.log.error("HSM_MailMonitor: exception: %s caught while checking reply for message: %s, reply: %s", str(e), repr(msg.payload), repr(newMsg)) except: self.log.error("HSM_MailMonitor: exception caught while checking reply from SPM, request was: %s reply: %s", diff --git a/vdsm_api/process-schema.py b/vdsm_api/process-schema.py index 58a4c8c..162fdf0 100755 --- a/vdsm_api/process-schema.py +++ b/vdsm_api/process-schema.py @@ -210,7 +210,7 @@ f.write('<table class="attrlist">\n') f.write('<caption>%s</caption>\n' % caption) if not names: - f.write('<tr><td class="attrlist">None</td>' \ + f.write('<tr><td class="attrlist">None</td>' '<td class="attrlist"></td></tr>\n') for name, dataType, desc in zip(names, types, details): f.write('<tr>') diff --git a/vdsm_cli/vdsClient.py b/vdsm_cli/vdsClient.py index c83dd7a..539c17a 100644 --- a/vdsm_cli/vdsClient.py +++ b/vdsm_cli/vdsClient.py @@ -1896,7 +1896,7 @@ '[,initiatorName=...])>', 'Connect to a storage low level entity (server)' )), - 'validateStorageServerConnection': \ + 'validateStorageServerConnection': (serv.validateStorageServerConnection, ('<server type> <spUUID> <conList (id=...,' 'connection=server:/export_path,portal=...,port=...' diff --git a/vdsm_reg/register-to-engine.py b/vdsm_reg/register-to-engine.py index 95333ed..d397c84 100755 --- a/vdsm_reg/register-to-engine.py +++ b/vdsm_reg/register-to-engine.py @@ -122,9 +122,9 @@ vdcHostName = None if not force and vdcHostName and "NONE" != vdcHostName.upper(): - sys.stdout.write('Node already configured to Engine %s\n' % \ + sys.stdout.write('Node already configured to Engine %s\n' % vdcHostName) - sys.stdout.write('Do you want to reset and use %s (yes/NO): ' % \ + sys.stdout.write('Do you want to reset and use %s (yes/NO): ' % newVdcHostName) ans = sys.stdin.readline() if "YES" != ans.strip().upper(): -- To view, visit http://gerrit.ovirt.org/8752 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id702c194ecff6e231539fd88fa20188f31326948 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
