Change in vdsm[master]: utils: janitorial: refactor utils.readMemInfo

asegurap at redhat.com asegurap at redhat.com
Wed Dec 4 14:54:54 UTC 2013


Antoni Segura Puimedon has posted comments on this change.

Change subject: utils: janitorial: refactor utils.readMemInfo
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

Some minor nits.

....................................................
File lib/vdsm/utils.py
Line 163:                                  IPXMLRPCServer):
Line 164:     allow_reuse_address = True
Line 165: 
Line 166: 
Line 167: def parseMemInfo(lines):
I'd probably make this _parseMemInfo. If we see that we need it outside this module we can always drop the leading underscore.
Line 168:     """
Line 169:     Parse the content of ``/proc/meminfo`` as list of strings
Line 170:     and return its content as a dictionary.
Line 171:     """


....................................................
File tests/utilsTests.py
Line 102:             self.assertTrue(isinstance(meminfo[field], int))
Line 103: 
Line 104:     def testParseMemInfo(self):
Line 105:         testPath = os.path.realpath(__file__)
Line 106:         dirName = os.path.split(testPath)[0]
shouldn't this be os.path.dirname?
Line 107:         path = os.path.join(dirName, "mem_info.out")
Line 108:         with open(path) as f:
Line 109:             meminfo = utils.parseMemInfo(f.readlines())
Line 110:         # testing some random fields


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ife98134e4512613fb9812f3162c7cd6a4af8fc89
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list