[PATCH] Fix DASD and zFCP device discovery (#530287).

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

 



Syntax error with kwargs in DASDDevice.  Use kwargs.pop() in both
DASDDevice and ZFCPDiskDevice so DASD or zFCP specific kwargs are not
passed to DiskDevice.__init__().

Remove the incorrect name variable setting in ZFCPDiskDevice.

Change 'devices' to 'device' in udev_device_get_zfcp_attribute() so that
zFCP attributes can be read.
---
 storage/devices.py |   17 ++++++++---------
 storage/udev.py    |    2 +-
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 8956a67..1b564f6 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -3133,12 +3133,11 @@ class ZFCPDiskDevice(DiskDevice):
     """ A mainframe ZFCP disk. """
     _type = "zfcp"
 
-    def __init__(self, name, **kwargs):
-        self.hba_id = kwargs.get("hba_id")
-        self.wwpn = kwargs.get("wwpn")
-        self.fcp_lun = kwargs.get("fcp_lun")
-        name = "zfcp://%s/%s/%s" % (self.hba_id, self.wwpn, self.fcplun,)
-        DiskDevice.__init__(self, name, **kwargs)
+    def __init__(self, device, **kwargs):
+        self.hba_id = kwargs.pop("hba_id")
+        self.wwpn = kwargs.pop("wwpn")
+        self.fcp_lun = kwargs.pop("fcp_lun")
+        DiskDevice.__init__(self, device, **kwargs)
 
     def __str__(self):
         s = DiskDevice.__str__(self)
@@ -3157,9 +3156,9 @@ class DASDDevice(DiskDevice):
     _type = "dasd"
 
     def __init__(self, device, **kwargs):
-        self.busid = kwargs.get('busid')
-        self.opts = kwargs.get('opts')
-        DiskDevice.__init__(self, device, kwargs)
+        self.busid = kwargs.pop('busid')
+        self.opts = kwargs.pop('opts')
+        DiskDevice.__init__(self, device, **kwargs)
 
     def dracutSetupString(self):
         arg = "rd_DASD=%s" % (self.busid,)
diff --git a/storage/udev.py b/storage/udev.py
index c4bce6e..ab6fbd1 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -198,7 +198,7 @@ def udev_device_get_zfcp_attribute(info, attr=None):
         log.debug("udev_device_get_zfcp_attribute() called with attr=None")
         return None
 
-    attribute = "/sys%s/devices/%s" % (info.get("sysfs_path"), attr,)
+    attribute = "/sys%s/device/%s" % (info.get("sysfs_path"), attr,)
     attribute = os.path.realpath(attribute)
 
     if not os.path.isfile(attribute):
-- 
1.6.2.5

_______________________________________________
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