[PATCH 2/3] Add FcoeDiskDevice class to storage/devices.py

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

 



---
 storage/devices.py |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index c2d4ec9..40501d7 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -359,7 +359,7 @@ class Device(object):
 class NetworkStorageDevice(object):
     """ Virtual base class for network backed storage devices """
 
-    def __init__(self, host_address):
+    def __init__(self, host_address=None, nic=None):
         """ Create a NetworkStorage Device instance. Note this class is only
             to be used as a baseclass and then only with multiple inheritance.
             The only correct use is:
@@ -369,13 +369,15 @@ class NetworkStorageDevice(object):
             1) Be able to check if a StorageDevice is network backed
                (using isinstance).
             2) To be able to get the host address of the host (server) backing
-               the storage.
+               the storage *or* the NIC through which the storage is connected
 
             Arguments:
 
                 host_address -- host address of the backing server
+                nic -- nic to which the storage is bound
         """
         self.host_address = host_address
+        self.nic = nic
 
 
 class StorageDevice(Device):
@@ -2927,10 +2929,23 @@ class iScsiDiskDevice(DiskDevice, NetworkStorageDevice):
         self.iscsi_address = kwargs.pop("iscsi_address")
         self.iscsi_port    = int(kwargs.pop("iscsi_port"))
         DiskDevice.__init__(self, device, **kwargs)
-        NetworkStorageDevice.__init__(self, self.iscsi_address)
+        NetworkStorageDevice.__init__(self, host_address=self.iscsi_address)
         log.debug("created new iscsi disk %s %s:%d" % (self.iscsi_name, self.iscsi_address, self.iscsi_port))
 
 
+class FcoeDiskDevice(DiskDevice, NetworkStorageDevice):
+    """ An FCoE disk. """
+    _type = "fcoe"
+    _packages = ["fcoe-utils"]
+
+    def __init__(self, device, **kwargs):
+        self.nic = kwargs.pop("nic")
+        self.identifier = kwargs.pop("identifier")
+        DiskDevice.__init__(self, device, **kwargs)
+        NetworkStorageDevice.__init__(self, nic=self.nic)
+        log.debug("created new fcoe disk %s @ %s" % (device, self.nic))
+
+
 class OpticalDevice(StorageDevice):
     """ An optical drive, eg: cdrom, dvd+r, &c.
 
-- 
1.6.2.2

_______________________________________________
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