Saggi Mizrahi has posted comments on this change.
Change subject: Make libvirtvm.py PEP8 compliant
......................................................................
Patch Set 1: (3 inline comments)
....................................................
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,
Only in function declarations. When using a function you don't need to align
the arguments.
http://www.python.org/dev/peps/pep-0008/#id12
# Extra indentation is not necessary.
foo = long_function_name(
var_one, var_two,
var_three, var_four)
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)
Spaces around operators.
http://www.python.org/dev/peps/pep-0008/#id20
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],
I don't think the spec specifies that.
Line 274: eInfo[dName])
Line 275: except (KeyError, TypeError):
Line 276: self._log.debug("Disk %s latency not available",
dName)
Line 277: else:
--
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 <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches