Dan Kenigsberg has posted comments on this change.
Change subject: Added blkid tool support in supervdsm.
......................................................................
Patch Set 3: I would prefer that you didn't submit this
(4 inline comments)
....................................................
File vdsm/blkid.py
Line 48: blkIdDict = dict(map(lambda x: x.split('=', 1), out))
I think out is expected to have empty lines, which would explode here
Line 49: regex = re.compile(r'\\x(\w{2})')
this should be compiled once, in import time.
Line 51: blkIdDict[k] = regex.sub(lambda x: binascii.unhexlify(x.group()[2:]), v)
I would trust you for this decoding, as I know nothing about blkid's -o udev. However,
I do not see the benefit of replacing dict values in place.
for line in out:
k, v = line.split
d[k] = decode(v)
would be one clearer pass.
Line 51: blkIdDict[k] = regex.sub(lambda x: binascii.unhexlify(x.group()[2:]), v)
I would trust you for this decoding, as I know nothing about blkid's -o udev. However,
I do not see the benefit of replacing dict values in place.
for line in out:
k, v = line.split
d[k] = decode(v)
would be one clearer pass.
--
To view, visit
http://gerrit.ovirt.org/2185
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia9ad51df4f4b98e2aff5db1d9c02512045977a60
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>