Change in vdsm[master]: Fixed parted utils for newer parted

danken at redhat.com danken at redhat.com
Fri Nov 28 20:37:11 UTC 2014


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 <dcaroest at redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Darshan N <dnarayan at redhat.com>
Gerrit-Reviewer: David Caro <dcaroest at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list