diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-04-14 15:29:23 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2010-04-15 09:02:43 +0200 |
commit | a25de00f7e2436296a5eb5c820929a0253135e94 (patch) | |
tree | 35764756a6be193563db8e62c67aceb3b4dd1246 /textw | |
parent | d708f0a6dfb85d484fa9e91f7e2b65cbf0f3851e (diff) | |
download | anaconda-a25de00f7e2436296a5eb5c820929a0253135e94.tar.gz anaconda-a25de00f7e2436296a5eb5c820929a0253135e94.tar.xz anaconda-a25de00f7e2436296a5eb5c820929a0253135e94.zip |
partition_text: Make addDriveDialog() not depend on anaconda.storage
This is a preparation patch for seperating addDriveDialog() and its
helper functions out of partition_text.py, so that it can be used for
rescue mode too.
Diffstat (limited to 'textw')
-rw-r--r-- | textw/partition_text.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/textw/partition_text.py b/textw/partition_text.py index f021e4f34..92036be2f 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -27,6 +27,9 @@ import string import copy import network import parted +import storage.iscsi +import storage.fcoe +import storage.zfcp from partIntfHelpers import * from snack import * from constants_text import * @@ -157,13 +160,11 @@ class PartitionTypeWindow: def addDriveDialog(self, screen): newdrv = [] - from storage import iscsi - if iscsi.has_iscsi(): + if storage.iscsi.has_iscsi(): newdrv.append("Add iSCSI target") if iutil.isS390(): newdrv.append( "Add zFCP LUN" ) - from storage import fcoe - if fcoe.has_fcoe(): + if storage.fcoe.has_fcoe(): newdrv.append("Add FCoE SAN") if len(newdrv) == 0: @@ -212,7 +213,7 @@ class PartitionTypeWindow: wwpn = entries[1].strip() fcplun = entries[2].strip() try: - self.anaconda.storage.zfcp.addFCP(devnum, wwpn, fcplun) + storage.zfcp.ZFCP().addFCP(devnum, wwpn, fcplun) except ValueError, e: log.warn(str(e)) # alternatively popup error dialog instead @@ -262,8 +263,8 @@ class PartitionTypeWindow: nic = interfaceList.current() dcb = dcbCheckbox.selected() - self.anaconda.storage.fcoe.addSan(nic=nic, dcb=dcb, - intf=self.anaconda.intf) + storage.fcoe.fcoe().addSan(nic=nic, dcb=dcb, + intf=self.anaconda.intf) screen.popWindow() return INSTALL_OK @@ -313,9 +314,8 @@ class PartitionTypeWindow: raise ValueError, msg iname = entries[1].strip() - if not self.anaconda.storage.iscsi.initiatorSet: - self.anaconda.storage.iscsi.initiator = iname - self.anaconda.storage.iscsi.addTarget(ip, port, user, pw, - user_in, pw_in) - + if not storage.iscsi.iscsi().initiatorSet: + storage.iscsi.iscsi().initiator = iname + storage.iscsi.iscsi().addTarget(ip, port, user, pw, user_in, pw_in) + return INSTALL_OK |