Dan Kenigsberg has uploaded a new change for review. Change subject: pep8: comply with E121 (indentation must be multiple of 4) ......................................................................
pep8: comply with E121 (indentation must be multiple of 4) Change-Id: Ie720de04c4b76a4d3575fb6dc8c540e2391e45dc Signed-off-by: Dan Kenigsberg <dan...@redhat.com> --- M Makefile.am M tests/libvirtvmTests.py M vdsm/configNetwork.py M vdsm/doc/source/conf.py M vdsm/kaxmlrpclib.py M vdsm/libvirtvm.py M vdsm/netinfo.py M vdsm/storage/lvm.py M vdsm/storage/nfsSD.py M vdsm/storage/resourceFactories.py M vdsm/storage/storage_exception.py M vdsm/storage/volume.py M vdsm_reg/define.py 13 files changed, 66 insertions(+), 68 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/9729/1 diff --git a/Makefile.am b/Makefile.am index 99e1a4f..11f0597 100644 --- a/Makefile.am +++ b/Makefile.am @@ -104,7 +104,7 @@ find . -path './.git' -prune -type f -o \ -name '*.py' -o -name '*.py.in' | xargs $(PYFLAKES) $(PEP8) --exclude="$(PEP8_BLACKLIST)" --filename '*.py,*.py.in' \ - --ignore=E121,E122,E123,E124,E125,E126,E127,E128,E241 \ + --ignore=E122,E123,E124,E125,E126,E127,E128,E241 \ $(PEP8_WHITELIST) @if test -f .gitignore; then \ for i in `git ls-files \*.in`; do \ diff --git a/tests/libvirtvmTests.py b/tests/libvirtvmTests.py index 4293276..8e7620f 100644 --- a/tests/libvirtvmTests.py +++ b/tests/libvirtvmTests.py @@ -284,10 +284,10 @@ def testControllerXML(self): devConfs = [ - {'device': 'ide', 'index': '0', 'address': self.PCI_ADDR_DICT}, - {'device': 'virtio-serial', 'address': self.PCI_ADDR_DICT}, - {'device': 'usb', 'model': 'ich9-ehci1', 'index': '0', - 'master': {'startport': '0'}, 'address': self.PCI_ADDR_DICT}] + {'device': 'ide', 'index': '0', 'address': self.PCI_ADDR_DICT}, + {'device': 'virtio-serial', 'address': self.PCI_ADDR_DICT}, + {'device': 'usb', 'model': 'ich9-ehci1', 'index': '0', + 'master': {'startport': '0'}, 'address': self.PCI_ADDR_DICT}] expectedXMLs = [ """ <controller index="0" type="ide"> @@ -323,20 +323,20 @@ def testDriveXML(self): SERIAL = '54-a672-23e5b495a9ea' devConfs = [ - {'index': '2', 'propagateErrors': 'off', 'iface': 'ide', - 'name': 'hdc', 'format': 'raw', 'device': 'cdrom', - 'path': '/tmp/fedora.iso', 'type': 'disk', 'readonly': 'True', - 'shared': 'False', 'serial': SERIAL}, + {'index': '2', 'propagateErrors': 'off', 'iface': 'ide', + 'name': 'hdc', 'format': 'raw', 'device': 'cdrom', + 'path': '/tmp/fedora.iso', 'type': 'disk', 'readonly': 'True', + 'shared': 'False', 'serial': SERIAL}, - {'index': '0', 'propagateErrors': 'on', 'iface': 'virtio', - 'name': 'vda', 'format': 'cow', 'device': 'disk', - 'path': '/tmp/disk1.img', 'type': 'disk', 'readonly': 'False', - 'shared': 'True', 'serial': SERIAL}, + {'index': '0', 'propagateErrors': 'on', 'iface': 'virtio', + 'name': 'vda', 'format': 'cow', 'device': 'disk', + 'path': '/tmp/disk1.img', 'type': 'disk', 'readonly': 'False', + 'shared': 'True', 'serial': SERIAL}, - {'index': '0', 'propagateErrors': 'off', 'iface': 'virtio', - 'name': 'vda', 'format': 'raw', 'device': 'disk', - 'path': '/dev/mapper/lun1', 'type': 'disk', 'readonly': 'False', - 'shared': 'False', 'serial': SERIAL}] + {'index': '0', 'propagateErrors': 'off', 'iface': 'virtio', + 'name': 'vda', 'format': 'raw', 'device': 'disk', + 'path': '/dev/mapper/lun1', 'type': 'disk', 'readonly': 'False', + 'shared': 'False', 'serial': SERIAL}] expectedXMLs = [ """ @@ -357,7 +357,7 @@ io="threads" name="qemu" type="qcow2"/> </disk>""", - """ + """ <disk device="disk" snapshot="no" type="block"> <source dev="/dev/mapper/lun1"/> <target bus="virtio" dev="vda"/> diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py index 09d70ac..78fd3af 100755 --- a/vdsm/configNetwork.py +++ b/vdsm/configNetwork.py @@ -728,7 +728,7 @@ for option in bondingOptions.split(): key, value = option.split('=') if not os.path.exists( - '/sys/class/net/%(bonding)s/bonding/%(key)s' % locals()): + '/sys/class/net/%(bonding)s/bonding/%(key)s' % locals()): raise ConfigNetworkError(ne.ERR_BAD_BONDING, "%r is not a valid bonding option" % key) except ValueError: @@ -1374,7 +1374,7 @@ d['nics'] = _ni.bondings[d['bonding']]['slaves'] d['bondingOptions'] = \ _ni.bondings[d['bonding']]['cfg'].get( - 'BONDING_OPTS', None) + 'BONDING_OPTS', None) else: d['nics'] = [d.pop('nic')] d['force'] = force diff --git a/vdsm/doc/source/conf.py b/vdsm/doc/source/conf.py index 693f289..4024217 100644 --- a/vdsm/doc/source/conf.py +++ b/vdsm/doc/source/conf.py @@ -171,9 +171,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'Vdsm.tex', u'VDSM Documentation', - u'Red Hat', 'manual'), +latex_documents = [('index', 'Vdsm.tex', u'VDSM Documentation', + u'Red Hat', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/vdsm/kaxmlrpclib.py b/vdsm/kaxmlrpclib.py index 2a087ae..8ab5e88 100644 --- a/vdsm/kaxmlrpclib.py +++ b/vdsm/kaxmlrpclib.py @@ -143,9 +143,9 @@ strict=None, timeout=CONNECTTIMEOUT, ca_certs=None, cert_reqs=ssl.CERT_REQUIRED): SecureXMLRPCServer.VerifyingHTTPSConnection.__init__( - self, host, port=port, key_file=key_file, cert_file=cert_file, - strict=strict, timeout=timeout, - ca_certs=ca_certs, cert_reqs=cert_reqs) + self, host, port=port, key_file=key_file, cert_file=cert_file, + strict=strict, timeout=timeout, + ca_certs=ca_certs, cert_reqs=cert_reqs) def connect(self): SecureXMLRPCServer.VerifyingHTTPSConnection.connect(self) diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py index 082b756..df9def0 100644 --- a/vdsm/libvirtvm.py +++ b/vdsm/libvirtvm.py @@ -194,8 +194,8 @@ try: stats['cpuSys'] = self._usagePercentage( - self._diff(eInfo, sInfo, 'user_time') - + self._diff(eInfo, sInfo, 'system_time'), + self._diff(eInfo, sInfo, 'user_time') + + self._diff(eInfo, sInfo, 'system_time'), sampleInterval) stats['cpuUser'] = self._usagePercentage( self._diff(eInfo, sInfo, 'cpu_time') @@ -489,9 +489,10 @@ self._preparingMigrationEvt = False if not self._migrationCanceledEvt: self._vm._dom.migrateToURI2( - duri, muri, None, - libvirt.VIR_MIGRATE_LIVE | libvirt.VIR_MIGRATE_PEER2PEER, - None, maxBandwidth) + duri, muri, None, + libvirt.VIR_MIGRATE_LIVE | + libvirt.VIR_MIGRATE_PEER2PEER, + None, maxBandwidth) finally: t.cancel() if MigrationMonitorThread._MIGRATION_MONITOR_INTERVAL: @@ -2306,8 +2307,8 @@ '%Y-%m-%dT%H:%M:%S'), time.gmtime(time.time() + newlife)) graphics.setAttribute( - 'passwdValidTo', - time.strftime('%Y-%m-%dT%H:%M:%S', validto)) + 'passwdValidTo', + time.strftime('%Y-%m-%dT%H:%M:%S', validto)) graphics.setAttribute('connected', 'keep') self._dom.updateDeviceFlags(graphics.toxml(), 0) @@ -2884,8 +2885,8 @@ self.log.debug('migration destination: waiting for VM creation') self._vmCreationEvent.wait() prepareTimeout = self._loadCorrectedTimeout( - config.getint('vars', 'migration_listener_timeout'), - doubler=5) + config.getint('vars', 'migration_listener_timeout'), + doubler=5) self.log.debug('migration destination: waiting %ss ' 'for path preparation', prepareTimeout) self._pathsPreparedEvent.wait(prepareTimeout) diff --git a/vdsm/netinfo.py b/vdsm/netinfo.py index f7d1799..2750662 100644 --- a/vdsm/netinfo.py +++ b/vdsm/netinfo.py @@ -323,14 +323,13 @@ else: raise - d['bridges'] = dict([(bridge, { - 'ports': ports(bridge), - 'stp': bridge_stp_state(bridge), - 'addr': getaddr(bridge), - 'netmask': getnetmask(bridge), - 'mtu': getMtu(bridge), - 'cfg': getIfaceCfg(bridge), - }) + d['bridges'] = dict([(bridge, {'ports': ports(bridge), + 'stp': bridge_stp_state(bridge), + 'addr': getaddr(bridge), + 'netmask': getnetmask(bridge), + 'mtu': getMtu(bridge), + 'cfg': getIfaceCfg(bridge), + }) for bridge in bridges()]) d['nics'] = dict([(nic, {'speed': speed(nic), diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py index 65badf7..e94f2f3 100644 --- a/vdsm/storage/lvm.py +++ b/vdsm/storage/lvm.py @@ -1200,8 +1200,8 @@ addTags = set(addTags) if delTags.intersection(addTags): raise se.VolumeGroupReplaceTagError( - "Cannot add and delete the same tag vg: `%s` tags: `%s`" - % (vgName, ", ".join(delTags.intersection(addTags)))) + "Cannot add and delete the same tag vg: `%s` tags: `%s`" % + (vgName, ", ".join(delTags.intersection(addTags)))) cmd = ["vgchange"] diff --git a/vdsm/storage/nfsSD.py b/vdsm/storage/nfsSD.py index 3a1c90e..78ed237 100644 --- a/vdsm/storage/nfsSD.py +++ b/vdsm/storage/nfsSD.py @@ -111,7 +111,7 @@ def findDomainPath(sdUUID): for tmpSdUUID, domainPath in fileSD.scanDomains("*"): if tmpSdUUID == sdUUID and mount.isMounted( - os.path.join(domainPath, "..")): + os.path.join(domainPath, "..")): return domainPath raise se.StorageDomainDoesNotExist(sdUUID) diff --git a/vdsm/storage/resourceFactories.py b/vdsm/storage/resourceFactories.py index 02aba0f..f53fa35 100644 --- a/vdsm/storage/resourceFactories.py +++ b/vdsm/storage/resourceFactories.py @@ -154,22 +154,22 @@ if template: if len(volUUIDChain) > 0: volRes = rmanager.acquireResource( - self.volumeResourcesNamespace, - template, rm.LockType.shared, - timeout=self.resource_default_timeout) + self.volumeResourcesNamespace, + template, rm.LockType.shared, + timeout=self.resource_default_timeout) else: volRes = rmanager.acquireResource( - self.volumeResourcesNamespace, - template, lockType, - timeout=self.resource_default_timeout) + self.volumeResourcesNamespace, + template, lockType, + timeout=self.resource_default_timeout) volResourcesList.append(volRes) # Acquire 'lockType' volume locks for volUUID in volUUIDChain: volRes = rmanager.acquireResource( - self.volumeResourcesNamespace, - volUUID, lockType, - timeout=self.resource_default_timeout) + self.volumeResourcesNamespace, + volUUID, lockType, + timeout=self.resource_default_timeout) volResourcesList.append(volRes) except (rm.RequestTimedOutError, se.ResourceAcqusitionFailed), e: diff --git a/vdsm/storage/storage_exception.py b/vdsm/storage/storage_exception.py index 54e64e6..71c5431 100644 --- a/vdsm/storage/storage_exception.py +++ b/vdsm/storage/storage_exception.py @@ -1285,8 +1285,8 @@ def __init__(self, domsizes, devsizes): self.value = "domlogblksize=%s domphyblksize=%s " \ "devlogblksize=%s devphyblksize=%s" % ( - domsizes[0], domsizes[1], - devsizes[0], devsizes[1]) + domsizes[0], domsizes[1], + devsizes[0], devsizes[1]) code = 517 message = "All devices in domain must have the same block size" diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py index dcc6c0b..3f82e08 100644 --- a/vdsm/storage/volume.py +++ b/vdsm/storage/volume.py @@ -174,8 +174,8 @@ sdUUID, srcImg, srcVol, dstFormat, srcParent) imageResourcesNamespace = sd.getNamespace( - sdUUID, - resourceFactories.IMAGE_NAMESPACE) + sdUUID, + resourceFactories.IMAGE_NAMESPACE) with rmanager.acquireResource(imageResourcesNamespace, srcImg, rm.LockType.exclusive): try: @@ -191,10 +191,10 @@ try: (rc, out, err) = qemuRebase( - vol.getVolumePath(), vol.getFormat(), - os.path.join('..', srcImg, srcParent), - int(dstFormat), misc.parseBool(unsafe), - vars.task.aborting, False) + vol.getVolumePath(), vol.getFormat(), + os.path.join('..', srcImg, srcParent), + int(dstFormat), misc.parseBool(unsafe), + vars.task.aborting, False) if rc: raise se.MergeVolumeRollbackError(srcVol) @@ -1010,9 +1010,9 @@ if (src_fmt == "raw" and dst_fmt == "raw" and dstvolType == PREALLOCATED_VOL): (rc, out, err) = misc.ddWatchCopy( - src=src, dst=dst, - stop=stop, size=size, - recoveryCallback=baseAsyncTasksRollback) + src=src, dst=dst, + stop=stop, size=size, + recoveryCallback=baseAsyncTasksRollback) else: cmd = constants.CMD_LOWPRIO + [constants.EXT_QEMUIMG, "convert", "-t", "none", "-f", src_fmt, src, diff --git a/vdsm_reg/define.py b/vdsm_reg/define.py index bb4e4bd..c665634 100644 --- a/vdsm_reg/define.py +++ b/vdsm_reg/define.py @@ -48,8 +48,7 @@ 'message': 'Sparse creation failed'}}, 'createErr': {'status': - { - 'code': 9, + {'code': 9, 'message': 'Error creating the requested Desktop'}}, 'noConPeer': {'status': -- To view, visit http://gerrit.ovirt.org/9729 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie720de04c4b76a4d3575fb6dc8c540e2391e45dc Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg <dan...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches