diff options
author | Chris Lumens <clumens@redhat.com> | 2006-07-12 13:59:19 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2006-07-12 13:59:19 +0000 |
commit | d0dec240385acda60a0591fbddd1cbcbdf9c20bc (patch) | |
tree | d5dfc075f489681cf1577170d06ad47d9b803329 /iscsi.py | |
parent | 143669aca0a87f5574924ea5aa6a52450a5311c6 (diff) | |
download | anaconda-d0dec240385acda60a0591fbddd1cbcbdf9c20bc.tar.gz anaconda-d0dec240385acda60a0591fbddd1cbcbdf9c20bc.tar.xz anaconda-d0dec240385acda60a0591fbddd1cbcbdf9c20bc.zip |
Use subprocess instead of our own code. Fix all calls to execWith* so
the command is no longer the first argument, since subprocess doesn't work
that way. Remove unneeded /proc/e820info cruft. Remove iutil.rmrf.
Diffstat (limited to 'iscsi.py')
-rw-r--r-- | iscsi.py | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -49,22 +49,22 @@ class iscsi: # # Issue the "action" request to recnum. # - argv = [ ISCSIADM, "-m", "node" ] - records = iutil.execWithCapture(argv[0], argv, searchPath = 1) + argv = [ "-m", "node" ] + records = iutil.execWithCapture(ISCSIADM, argv) for line in records.split("\n"): if line: recnum = line.split()[0][1:-1] - argv = [ ISCSIADM, "-m", "node", "-r", "%s" % (recnum,), + argv = [ "-m", "node", "-r", "%s" % (recnum,), "%s" % (action,) ] - iutil.execWithRedirect(argv[0], argv, searchPath = 1, + iutil.execWithRedirect(ISCSIADM, argv, searchPath = 1, stdout = "/dev/tty5", stderr = "/dev/tty5") # ... and now we have to make it start automatically - argv = [ ISCSIADM, "-m", "node", "-r", "%s" %(recnum,), + argv = [ "-m", "node", "-r", "%s" %(recnum,), "-o", "update", "-n", "node.startup", "-v", "automatic" ] - iutil.execWithRedirect(argv[0], argv, searchPath = 1, + iutil.execWithRedirect(ISCSIADM, argv, searchPath = 1, stdout = "/dev/tty5", stderr = "/dev/tty5") @@ -76,8 +76,8 @@ class iscsi: self.action("--logout") # XXX use iscsiadm shutdown when it's available. - argv = [ "ps", "--no-headers", "-C", "%s" % (ISCSID,) ] - psout = iutil.execWithCapture(argv[0], argv, searchPath = 1) + argv = [ "--no-headers", "-C", "%s" % (ISCSID,) ] + psout = iutil.execWithCapture("ps", argv) for line in psout.split("\n"): if line: pid = string.atoi(string.split(line)[0]) @@ -113,12 +113,11 @@ class iscsi: if not os.path.exists(ISCSID_DB_DIR): iutil.mkdirChain(ISCSID_DB_DIR) - argv = [ ISCSID ] - iutil.execWithRedirect(argv[0], argv, searchPath = 1) + iutil.execWithRedirect(ISCSIID, [], searchPath = 1) - argv = [ ISCSIADM, "-m", "discovery", "-t", "st", "-p", + argv = [ "-m", "discovery", "-t", "st", "-p", "%s:%s" % (self.ipaddr, self.port) ] - iutil.execWithRedirect(argv[0], argv, searchPath = 1, + iutil.execWithRedirect(ISCSIADM, argv, searchPath = 1, stdout = "/dev/tty5", stderr="/dev/tty5") self.action("--login") |