summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-10-27 19:45:15 +0100
committerHans de Goede <hdegoede@redhat.com>2009-10-28 10:27:53 +0100
commit0d974cb8a7cee879de6695b8b09c9f61c2c99a12 (patch)
treec42b1a3328bf33e5cefba6d624e9d8cc205e8852
parent81b7b447818db245359dea1a4eb23a07b916f720 (diff)
downloadanaconda-0d974cb8a7cee879de6695b8b09c9f61c2c99a12.tar.gz
anaconda-0d974cb8a7cee879de6695b8b09c9f61c2c99a12.tar.xz
anaconda-0d974cb8a7cee879de6695b8b09c9f61c2c99a12.zip
When doing initlabel on a dasd disk create a dasd disklabel (#531209)
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.
-rw-r--r--platform.py11
-rw-r--r--storage/formats/disklabel.py3
2 files changed, 6 insertions, 8 deletions
diff --git a/platform.py b/platform.py
index 66e222c58..c0cc60295 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 a6e3352ee..8f003fc17 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