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

[PATCH 06/05] add iscsi text install



Add iscsi text install module and call to it.

diff -uprN -X /home/patman/dontdiff anaconda-10.91.12/text.py iscsi-anaconda-10.91.12/text.py
--- anaconda-10.91.12/text.py	2006-01-25 19:14:52.000000000 -0800
+++ iscsi-anaconda-10.91.12/text.py	2006-02-02 12:54:46.000000000 -0800
@@ -41,6 +41,7 @@ stepToClasses = {
     "mouse" : ("mouse_text", ("MouseWindow", "MouseDeviceWindow")),
     "welcome" : ("welcome_text", "WelcomeWindow"),
     "installtype" : ("installpath_text", "InstallPathWindow"),
+    "iscsi" : ("iscsi_text", "iscsiWindow"),
     "parttype" : ("partition_text", "PartitionTypeWindow"),    
     "custom-upgrade" : ("upgrade_text", "UpgradeExamineWindow"),
     "addswap" : ("upgrade_text", "UpgradeSwapWindow"),
diff -uprN -X /home/patman/dontdiff anaconda-10.91.12/textw/iscsi_text.py iscsi-anaconda-10.91.12/textw/iscsi_text.py
--- anaconda-10.91.12/textw/iscsi_text.py	1969-12-31 16:00:00.000000000 -0800
+++ iscsi-anaconda-10.91.12/textw/iscsi_text.py	2006-02-02 12:53:06.000000000 -0800
@@ -0,0 +1,87 @@
+#
+# iscs_text.py: iscsi text dialog
+#
+# Copyright 2006 IBM
+#
+# This software may be freely redistributed under the terms of the GNU
+# general public license.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+import isys
+from network import sanityCheckIPString
+from snack import *
+from constants import *
+from constants_text import *
+from rhpl.translate import _
+import logging
+log = logging.getLogger("anaconda")
+
+class iscsiWindow:
+    def __call__(self, screen, iscsi, intf):
+        self.iscsi = iscsi
+
+        # We have 3 values of interest: target IP address, port and
+        # initiator name.
+        #
+        # Create a Grid that is 2 columns (label and value) by 3 rows in
+        # size.
+        grid = Grid(2, 3)
+
+        row = 0
+        self.ip_entry = Entry (16)
+        # if self.iscsi.ipaddr:
+        self.ip_entry.set(self.iscsi.ipaddr)
+        grid.setField(Label("Target IP address"), 0, row, anchorLeft = 1)
+        grid.setField(self.ip_entry, 1, row, anchorLeft = 1,
+                      padding = (1, 0, 0, 0))
+
+        row += 1
+        self.port_entry = Entry(16)
+        self.port_entry.set(self.iscsi.port)
+        grid.setField(Label("port"), 0, row, anchorLeft = 1)
+        grid.setField(self.port_entry, 1, row, anchorLeft = 1,
+                      padding = (1, 0, 0, 0))
+
+        row +=1
+        self.initiator_entry = Entry(32)
+        # if self.iscsi.initiator:
+        self.initiator_entry.set(self.iscsi.initiator)
+        grid.setField(Label("Initiator Name"), 0, row, anchorLeft = 1)
+        grid.setField(self.initiator_entry, 1, row, anchorLeft = 1,
+                      padding = (1, 0, 0, 0))
+
+        bb = ButtonBar(screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON))
+
+        toplevel = GridFormHelp(screen, _("iSCSI Configuration"), "iSCSI", 1, 5)
+        toplevel.add(grid, 0, 1, (0, 0, 0, 1), anchorLeft = 1)
+        toplevel.add(bb, 0, 3, growx = 1)
+
+        while 1:
+            result = toplevel.run()
+            rc = bb.buttonPressed (result)
+            if rc == TEXT_BACK_CHECK:
+                screen.popWindow()
+                return INSTALL_BACK
+            self.iscsi.ipaddr = self.ip_entry.value()
+            if not self.iscsi.ipaddr:
+                # XXX warn no iscsi configuration ...
+                break
+            if sanityCheckIPString(self.iscsi.ipaddr) is None:
+                ButtonChoiceWindow(screen, _("Invalid IP string"),
+                                   _("The entered IP '%s' is not a valid IP.")
+                                   %(self.iscsi.ipaddr), 
+                                   buttons = [ _("OK") ])
+                continue
+            self.iscsi.port = self.port_entry.value()
+            self.iscsi.initiator = self.initiator_entry.value()
+            break
+
+        screen.popWindow()
+        self.iscsi.startup()
+        return INSTALL_OK
+
+# vim:tw=78:ts=4:et:sw=4


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