Dan Kenigsberg has posted comments on this change.

Change subject: Fixed parted utils for newer parted
......................................................................


Patch Set 2: Code-Review-1

(1 comment)

Thanks for the fix - would you consider a cleaner one?

http://gerrit.ovirt.org/#/c/35700/2/vdsm/parted_utils.py
File vdsm/parted_utils.py:

Line 41:         freeBytes = region.length * partedDevice.sectorSize
Line 42:         freeRegionList.append((region.start, region.end,
Line 43:                                region.length, freeBytes))
Line 44:     partitions = {}
Line 45:     for partition in partedDisk.partitions:
this code undoes what getFlagsAsString does 
(see/usr/lib64/python2.6/site-packages/parted/partition.py) . A cleaner aproach 
is

flags = [
    flagname for (flag, flagname)
    in parted.partition.partitionFlag.items()
    if parted.partition.getFlag(flag)
]
Line 46:         partitionFlags = [
Line 47:             flag.endswith(',') and flag[:-1] or flag
Line 48:             for flag in partition.getFlagsAsString().split()
Line 49:         ]


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I21b5842abb03f08b15b067c0c6e5889091bcdc5d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: David Caro <[email protected]>
Gerrit-Reviewer: Bala.FA <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Darshan N <[email protected]>
Gerrit-Reviewer: David Caro <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to