summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-07-02 22:00:12 +0200
committerHans de Goede <hdegoede@redhat.com>2009-07-02 22:05:41 +0200
commit7a7ce782b86dc13633dcf3715a1f65f832145c57 (patch)
treee65683f1cb13efe12d0212d1da261f8ba2173d5b /storage
parent62eedb84edad72cb4091e7db52dfd0be8581cc56 (diff)
downloadanaconda-7a7ce782b86dc13633dcf3715a1f65f832145c57.tar.gz
anaconda-7a7ce782b86dc13633dcf3715a1f65f832145c57.tar.xz
anaconda-7a7ce782b86dc13633dcf3715a1f65f832145c57.zip
Add FcoeDiskDevice class to storage/devices.py
Diffstat (limited to 'storage')
-rw-r--r--storage/devices.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/storage/devices.py b/storage/devices.py
index c2d4ec951..40501d707 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.