Change in vdsm[master]: Make libvirtvm.py PEP8 compliant

asegurap at redhat.com asegurap at redhat.com
Wed Aug 22 23:59:58 UTC 2012


Antoni Segura Puimedon has posted comments on this change.

Change subject: Make libvirtvm.py PEP8 compliant
......................................................................


Patch Set 1: I would prefer that you didn't submit this

(4 inline comments)

Just some indentations do not seem to follow completely pep8.

....................................................
File vdsm/libvirtvm.py
Line 81:                              config.getint('vars', 'vm_sample_net_interval'),
Line 82:                              config.getint('vars', 'vm_sample_net_window'))
Line 83: 
Line 84:         self.addStatsFunction(self.highWrite, self.updateVolumes,
Line 85:                 self.sampleCpu, self.sampleDisk, self.sampleDiskLatency,
If I am not mistaken, according to PEP8, if you put at least one parameter after opening parenthesis, the indentation of the rest of the lines before the closing parenthesis must be column of opening parenthesis + 1 (as it was before).
Line 86:                 self.sampleNet)
Line 87: 
Line 88:     def _highWrite(self):
Line 89:         if not self._vm._volumesPrepared:


Line 118:                     vmDrive.apparentsize = int(volSize['apparentsize'])
Line 119: 
Line 120:     def _sampleCpu(self):
Line 121:         state, maxMem, memory, nrVirtCpu, cpuTime = self._vm._dom.info()
Line 122:         return cpuTime / (1000 ** 3)
I think the previous version was already PEP8 compliant.
Line 123: 
Line 124:     def _sampleDisk(self):
Line 125:         if not self._vm._volumesPrepared:
Line 126:             # Avoid queries from storage during recovery process


Line 269:                         'writeLatency': '0',
Line 270:                         'flushLatency': '0'}
Line 271:             try:
Line 272:                 (dLatency['readLatency'], dLatency['writeLatency'],
Line 273:                 dLatency['flushLatency']) = _avgLatencyCalc(sInfo[dName],
Shouldn't dLatency here be aligned to the previous line one?
Line 274:                         eInfo[dName])
Line 275:             except (KeyError, TypeError):
Line 276:                 self._log.debug("Disk %s latency not available", dName)
Line 277:             else:


Line 428:                 self._vm._vmStats.cont()
Line 429:                 raise
Line 430:         else:
Line 431:             hooks.before_vm_migrate_source(self._vm._dom.XMLDesc(0),
Line 432:                     self._vm.conf)
Alignment like in the first comment. Idem in 437, 620
Line 433:             response = self.destServer.migrationCreate(self._machineParams)
Line 434:             if response['status']['code']:
Line 435:                 self.status = response
Line 436:                 raise RuntimeError('migration destination error: ' +


--
To view, visit http://gerrit.ovirt.org/7422
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I32570c2d1a2efa4a5446caa6d973a10b4c84d996
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list