Re: [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]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Both of these patches look good to me.

On Tue, 27 Oct 2009, Hans de Goede wrote:

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


- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkrnumEACgkQ5hsjjIy1Vkl9iwCfSnSlh57ibOML3pN+aCZq4jLU
qBUAoIuV5djitMQvwXIj7lM6G1ttKlgc
=aqO3
-----END PGP SIGNATURE-----

_______________________________________________
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