Change in vdsm[ovirt-3.5]: Fixed parted utils for newer parted

dcaroest at redhat.com dcaroest at redhat.com
Fri May 8 14:39:42 UTC 2015


David Caro has uploaded a new change for review.

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

Fixed parted utils for newer parted

In the newer parted, the new flag 'esp' is added to the 'boot' flag on all
partitions.

Also fixed issue where we returned the trailing commas when a partition had
more than one flag.

Change-Id: I21b5842abb03f08b15b067c0c6e5889091bcdc5d
Signed-off-by: David Caro <dcaroest at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35700
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-by: Bala.FA <barumuga at redhat.com>
Reviewed-by: Petr Horáček <phoracek at redhat.com>
(cherry picked from commit 1d399bc3f914f6230234ae9db4bb324f498e30ee)
---
M tests/parted_utils_tests.py
M vdsm/parted_utils.py
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/40703/1

diff --git a/tests/parted_utils_tests.py b/tests/parted_utils_tests.py
index ce413d7..adc51c9 100644
--- a/tests/parted_utils_tests.py
+++ b/tests/parted_utils_tests.py
@@ -104,7 +104,7 @@
         partName = '%sp1' % self.devPath
         partInfo = info['partitions'].get(partName)
         self.assertTrue(partInfo)
-        self.assertEquals(partInfo[0], ['boot'])
+        self.assertIn(partInfo[0], (['boot'], ['boot', 'esp']))
         self.assertTrue(partInfo[1] >= 0)
         self.assertTrue((partInfo[2] * info['sectorSize']) >= PART_END_SIZE)
 
diff --git a/vdsm/parted_utils.py b/vdsm/parted_utils.py
index f394985..31d40dc 100644
--- a/vdsm/parted_utils.py
+++ b/vdsm/parted_utils.py
@@ -43,8 +43,11 @@
                                region.length, freeBytes))
     partitions = {}
     for partition in partedDisk.partitions:
+        partitionFlags = [flagname for (flag, flagname)
+                          in parted.partition.partitionFlag.items()
+                          if partition.getFlag(flag)]
         partitions.update({partition.path:
-                           (partition.getFlagsAsString().split(),
+                           (partitionFlags,
                             partition.geometry.start,
                             partition.geometry.end)})
 


-- 
To view, visit https://gerrit.ovirt.org/40703
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21b5842abb03f08b15b067c0c6e5889091bcdc5d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: David Caro <dcaroest at redhat.com>


More information about the vdsm-patches mailing list