[node-patches] Change in ovirt-node[master]: Add utils.system.Bootloader

nsoffer at redhat.com nsoffer at redhat.com
Sat Oct 5 23:04:44 UTC 2013


Nir Soffer has posted comments on this change.

Change subject: Add utils.system.Bootloader
......................................................................


Patch Set 4:

(2 comments)

....................................................
File src/ovirt/node/utils/system.py
Line 95:     """
Line 96:     try:
Line 97:         process.call(["partprobe"] + [x for x in glob.glob("/dev/mapper/*")
Line 98:                                       if not re.match(r'.*\/control$', x)])
Line 99:         process.call(["udevadm", "settle"])
Now it is very clear. I suggest to move both calls out of the try-except, since they will never raise the checked exception, and document why the return value is ignored.
Line 100:         process.check_call(["/sbin/blkid", "-c", "/dev/null", "-l", "-o",
Line 101:                             "device", "-t", 'LABEL="%s"' % label])
Line 102: 
Line 103:         # If we made it here, there are no non-zero exit codes, and we can


Line 100:         process.check_call(["/sbin/blkid", "-c", "/dev/null", "-l", "-o",
Line 101:                             "device", "-t", 'LABEL="%s"' % label])
Line 102: 
Line 103:         # If we made it here, there are no non-zero exit codes, and we can
Line 104:         # assume we found  a filesystem with this label
check_call is documented to return only 0, I don't see a need to explain that. The fact that you return a boolean tell the reader that you are not interested in the return value.
Line 105:         return True
Line 106: 
Line 107:     except process.CalledProcessError as e:
Line 108:         log.exception("Failed to resolve disks: %s" % e)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5a796a4c07bd99b927070ec62a7b1d990d4e1f9b
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Ryan Barry <rbarry at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes



More information about the node-patches mailing list