[PATCH 2/2] When doing initlabel on a dasd disk create a dasd disklabel (#531209)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As discussed on IRC this changes the platform.diskType property
into a platform.diskLabelType method that takes a disk/device type argument
and uses this argument to check for dasd disks and in that cases returns
dasd as diskLabelType.
---
 platform.py                  |   11 ++++-------
 storage/formats/disklabel.py |    3 ++-
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/platform.py b/platform.py
index 66e222c..c0cc602 100644
--- a/platform.py
+++ b/platform.py
@@ -139,15 +139,12 @@ class Platform(object):
 
         return errors
 
-    @property
-    def diskLabelType(self):
+    def diskLabelType(self, deviceType):
         """Return the disk label type as a parted.DiskType."""
-        return self._diskLabelType
+        if deviceType == parted.DEVICE_DASD:
+            return parted.diskType["dasd"]
 
-    @diskLabelType.setter
-    def diskLabelType(self, value):
-        """Sets the disk label type."""
-        self._diskLabelType = value
+        return self._diskLabelType
 
     @property
     def isEfi(self):
diff --git a/storage/formats/disklabel.py b/storage/formats/disklabel.py
index a6e3352..8f003fc 100644
--- a/storage/formats/disklabel.py
+++ b/storage/formats/disklabel.py
@@ -92,7 +92,8 @@ class DiskLabel(DeviceFormat):
     def freshPartedDisk(self):
         """ Return a new, empty parted.Disk instance for this device. """
         log_method_call(self, device=self.device)
-        labelType = platform.getPlatform(None).diskLabelType
+        platf = platform.getPlatform(None)
+        labelType = platf.diskLabelType(self.partedDevice.type)
         return parted.freshDisk(device=self.partedDevice, ty=labelType)
 
     @property
-- 
1.6.5.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux