Alon Bar-Lev has posted comments on this change.

Change subject: Adding getBiosInfo API to vdsm cli and merge bios information 
with vdsGetCaps
......................................................................


Patch Set 11: (3 inline comments)

Few notes about the ugly dmidecodeUtil... Can't comment the rest due to lack of 
knowledge.

....................................................
File vdsm/dmidecodeUtil.py
Line 34: def getAllDmidecodeInfo():
Line 35:     myLeafDict = {}
Line 36:     arrangedSystem = {}
Line 37:     __leafDict(dmidecode.system(), arrangedSystem)
Line 38:     myLeafDict['system'] = arrangedSystem
should be:

 for k in ('system', 'bios', ...):
    t = {}
     __leafDict(dmidecode.get(k), t)
    myLeafDict[k] = t

but why leafDict cannot return t?

In python, there should be no problem to convert k into method name even if 
there is no get method.
Line 39:     arrangedBios = {}
Line 40:     __leafDict(dmidecode.bios(), arrangedBios)
Line 41:     myLeafDict['bios'] = arrangedBios
Line 42:     arrangedCache = {}


Line 63:     sysStruct['systemProductName'] = dmiInfo['system']['Product Name']
Line 64:     sysStruct['systemVersion'] = dmiInfo['system']['Version']
Line 65:     sysStruct['systemSerialNumber'] = dmiInfo['system']['Serial 
Number']
Line 66:     sysStruct['systemUUID'] = dmiInfo['system']['UUID']
Line 67:     sysStruct['systemFamily'] = dmiInfo['system']['Family']
Should be:

 for k1, k2 in (
    ( 'system', 'Manufacturer'),
    ...
 ):
    sysStruct[k2+k2] = dmInfo[k1][k2]
Line 68: 
Line 69:     return sysStruct
Line 70: 
Line 71: 


Line 68: 
Line 69:     return sysStruct
Line 70: 
Line 71: 
Line 72: def printInfo(d):
This should be:

 print(
      """bla bla bla {system} bla bla
bla bla bla {bios} bla
...
""".format(
       system=d['system'],
       bios=d['bios'],
etc...
    )
 )
Line 73:     print 'SYSTEM INFORMATION:'
Line 74:     print '=================='
Line 75:     print ''
Line 76:     for i in d['system']:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic429ef101fcf9047c4b552405314dc7ba9ba07a0
Gerrit-PatchSet: 11
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Andrew Cathrow <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to