Change in vdsm[master]: ppc64: unable to list online logical CPUs
kmp at linux.vnet.ibm.com
kmp at linux.vnet.ibm.com
Mon Mar 23 18:11:49 UTC 2015
Madhu Pavan has posted comments on this change.
Change subject: ppc64: unable to list online logical CPUs
......................................................................
Patch Set 2:
(3 comments)
https://gerrit.ovirt.org/#/c/38983/2/vdsm/ppc64HardwareInfo.py
File vdsm/ppc64HardwareInfo.py:
Line 58:
Line 59: return infoStructure
Line 60:
Line 61:
Line 62: def parseCpus(value):
> this can (and should) be private. Please name new functions according to pe
sure
Line 63: onlineCpus = []
Line 64: if value.find(',') == -1 and value.find('-') == -1:
Line 65: onlineCpus.append(str(value))
Line 66: elif value.find(',') == -1:
Line 61:
Line 62: def parseCpus(value):
Line 63: onlineCpus = []
Line 64: if value.find(',') == -1 and value.find('-') == -1:
Line 65: onlineCpus.append(str(value))
> I still do not understand the str() conversion. What is value exactly? why
"value" here is a integer which represents online cpu. We need to convert it to string because in the next stage all these string items are joined (as caps['onlineCpus'] = ','.join(cpuTopology.onlineCpus()))
Line 66: elif value.find(',') == -1:
Line 67: cpuindex = value.split('-')
Line 68: for cpu in range(int(cpuindex[0]), int(cpuindex[1])+1):
Line 69: onlineCpus.append(str(cpu))
Line 64: if value.find(',') == -1 and value.find('-') == -1:
Line 65: onlineCpus.append(str(value))
Line 66: elif value.find(',') == -1:
Line 67: cpuindex = value.split('-')
Line 68: for cpu in range(int(cpuindex[0]), int(cpuindex[1])+1):
> style: use spaces around operators like "+".
sure
Line 69: onlineCpus.append(str(cpu))
Line 70: else:
Line 71: for cpusets in value.split(','):
Line 72: if cpusets.find('-') == -1:
--
To view, visit https://gerrit.ovirt.org/38983
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia5c4bdbc00217516ba3b7e361ab28e409c507baa
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Madhu Pavan <kmp at linux.vnet.ibm.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Madhu Pavan <kmp at linux.vnet.ibm.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list