Re: [PATCH 5/7] Modify StorageDevice.fstabSpec() to use by-path for DASD (#526364).

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

 



sorry, but NACK,

This sort of device specific handling should not be done in the
generic StorageDevice class, instead
devicetree.py: addUdevDiskDevice()
Should be teached to recognize DASD disks and add them with a type
of DASDDevice, and DASDDevice should override fstabSpec().

Regards,

Hans


On 10/08/2009 09:28 AM, David Cantrell wrote:
If the partition is on a DASD disk, write out the /dev/disk/by-path/...
value to the /etc/fstab file rather than a UUID= line.
---
  storage/devices.py |   17 ++++++++++++++---
  1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 9d257e2..6cd7b5a 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -556,9 +556,20 @@ class StorageDevice(Device):

      @property
      def fstabSpec(self):
-        spec = self.path
-        if self.format and self.format.uuid:
-            spec = "UUID=%s" % self.format.uuid
+        spec = None
+
+        try:
+            if self.format:
+                if self.disk and self.disk.format.partedDisk.type == 'dasd':
+                    spec = deviceNameToDiskByPath(self.path)
+                elif self.format.uuid:
+                    spec = "UUID=%s" % self.format.uuid
+        except AttributeError as msg:
+            log.error("fstabSpec called for %s: %s" % (self.path, msg,))
+
+        if not spec:
+            spec = self.path
+
          return spec

      def resize(self, intf=None):

_______________________________________________
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