[master 1/1] Add method to list primary partitions

vojtechtrefny installerbot-noreply at redhat.com
Thu Jul 23 12:08:51 UTC 2015


From: Vojtech Trefny <vtrefny at redhat.com>

Signed-off-by: Vojtech Trefny <vtrefny at redhat.com>
---
 blivet/formats/disklabel.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/blivet/formats/disklabel.py b/blivet/formats/disklabel.py
index 94cdfbd..ba5e1a4 100644
--- a/blivet/formats/disklabel.py
+++ b/blivet/formats/disklabel.py
@@ -324,6 +324,15 @@ def logicalPartitions(self):
         return logicals
 
     @property
+    def primaryPartitions(self):
+        try:
+            primaries = self.partedDisk.getPrimaryPartitions()
+        except Exception: # pylint: disable=broad-except
+            log_exception_info()
+            primaries = []
+        return primaries
+
+    @property
     def firstPartition(self):
         try:
             part = self.partedDisk.getFirstPartition()


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/01c833d9e31f6c7108b7ff0faca727bcb0231312


More information about the anaconda-patches mailing list