Re: [PATCH] Backport Fedora-11 libiscsi iscsi code (#497438)

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

 



Hi all,

2 notes:

1) For the review it might be easier to take a look at the differences compared to the
   Fedora-11 iscsy.py, diff attached

2) This has been *extensively* tested, here is the test matrix I used:

i386:
* ibft dhcp   gui autopart reverse chap			OK
* ibft static gui autopart chap				OK
* ibft static gui autopart none				OK
* noibft gui check entering only password		OK
* noibft gui check entering wrong credentials		OK
* noibft gui reversechap				OK
* noibft gui chap					OK
* noibft gui none					OK
* noibft text check entering only password		OK
* noibft text check entering wrong credentials		OK
* noibft text reversechap				OK
* check ibft disk being seen to upgrade from		OK
* check ibft disk being seen in rescue mode		OK
* ibft dhcp kickstart reverse chap			OK
* noibft kickstart chap					OK

x86_64:
* ibft dhcp gui autopart reverse chap			OK
* noibft text chap					OK


Regards,

Hans
--- ../anaconda/storage/iscsi.py	2009-05-06 08:36:12.000000000 +0200
+++ iscsi.py	2009-05-06 10:23:31.000000000 +0200
@@ -1,36 +1,28 @@
 #
 # iscsi.py - iscsi class
 #
-# Copyright (C) 2005, 2006  IBM, Inc.  All rights reserved.
-# Copyright (C) 2006  Red Hat, Inc.  All rights reserved.
+# Copyright 2005, 2006 IBM, Inc.,
+# Copyright 2006  Red Hat, Inc.
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# 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, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 
-from constants import *
 import os
 import iutil
+import isys
 from flags import flags
 import logging
 import shutil
 import time
-import hashlib
-import random
+import md5, random
 log = logging.getLogger("anaconda")
 
-import gettext
-_ = lambda x: gettext.ldgettext("anaconda", x)
+from rhpl.translate import _, N_
 
 has_libiscsi = True
 try:
@@ -65,8 +57,8 @@
 def randomIname():
     """Generate a random initiator name the same way as iscsi-iname"""
     
-    s = "iqn.1994-05.com.fedora:01."
-    m = hashlib.md5()
+    s = "iqn.1994-05.com.rhel:01."
+    m = md5.md5()
     u = os.uname()
     for i in u:
         m.update(i)
@@ -81,12 +73,12 @@
     if intf:
         w = intf.waitWindow(_("Scanning iSCSI nodes"),
                             _("Scanning iSCSI nodes"))
-    # It is possible when we get here the events for the new devices
-    # are not send yet, so sleep to make sure the events are fired
     time.sleep(2)
-    iutil.execWithRedirect("udevadm", [ "settle" ],
-                           stdout = "/dev/tty5", stderr="/dev/tty5",
-                           searchPath = 1)
+
+    # ensure we have device nodes for our partitions
+    isys.flushDriveDict()
+    iutil.makeDriveDeviceNodes()
+
     if intf:
         w.pop()
 
@@ -157,7 +149,7 @@
                                 _("Initializing iSCSI initiator"))
 
         log.debug("Setting up %s" % (INITIATOR_FILE, ))
-        log.info("iSCSI initiator name %s", self.initiator)
+        log.info("iSCSI initiator name %s" % (self.initiator,))
         if os.path.exists(INITIATOR_FILE):
             os.unlink(INITIATOR_FILE)
         if not os.path.isdir("/etc/iscsi"):
@@ -255,27 +247,11 @@
                     f.write(" --reverse-password %s" % auth.reverse_password)
             f.write("\n")
 
-    def write(self, instPath, anaconda):
+    def write(self, instPath):
         if not self.initiatorSet:
             return
 
         if not flags.test:
-            root = anaconda.id.storage.fsset.rootDevice
-            disks = anaconda.id.storage.devicetree.getDevicesByType("iscsi")
-
-            # set iscsi nodes to autostart
-            for disk in disks:
-                # devices used for root get started by the initrd
-                if root.dependsOn(disk):
-                    continue
-                # find the iscsi node matching this disk
-                for node in self.nodes:
-                    if node.name    == disk.iscsi_name and \
-                       node.address == disk.iscsi_address and \
-                       node.port    == disk.iscsi_port:
-                        node.setParameter("node.startup", "automatic")
-                        break
-
             if not os.path.isdir(instPath + "/etc/iscsi"):
                 os.makedirs(instPath + "/etc/iscsi", 0755)
             fd = os.open(instPath + INITIATOR_FILE, os.O_RDWR | os.O_CREAT)
_______________________________________________
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