[PATCH rhel6-branch 3/6] partition_text: Make addDriveDialog() not depend on anaconda.storage

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

 



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.
---
 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 a299b94..04e7e12 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.id.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.id.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.id.storage.iscsi.initiatorSet:
-            self.anaconda.id.storage.iscsi.initiator = iname
-        self.anaconda.id.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
-- 
1.7.0.1

_______________________________________________
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