[PATCH 3/3] remove dead code (setMethodstr, expandFTPMethod)

Will Woods wwoods at redhat.com
Thu Aug 23 00:54:21 UTC 2012


Nothing uses a method/repo of 'cdrom://<dev>:<path>' anymore, and
nothing passes a method like '@/tmp/filename', so this code is all
useless.
---
 anaconda               | 24 +-----------------------
 pyanaconda/__init__.py | 15 ---------------
 2 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/anaconda b/anaconda
index 88f4fa9..f86cdf4 100755
--- a/anaconda
+++ b/anaconda
@@ -321,20 +321,6 @@ def setupLoggingFromOpts(opts):
     if opts.syslog:
         anaconda_log.logger.remote_syslog = opts.syslog
 
-# ftp installs pass the password via a file in /tmp so
-# ps doesn't show it
-def expandFTPMethod(str):
-    ret = None
-
-    try:
-        filename = str[1:]
-        ret = open(filename, "r").readline()
-        ret = ret[:len(ret) - 1]
-        os.unlink(filename)
-        return ret
-    except:
-        return None
-
 def gtk_warning(title, reason):
     import gtk
     dialog = gtk.MessageDialog(type = gtk.MESSAGE_ERROR,
@@ -748,17 +734,9 @@ if __name__ == "__main__":
         anaconda.updateSrc = opts.updateSrc
 
     if opts.method:
-        if opts.method[0] == '@':
-            opts.method = expandFTPMethod(opts.method)
-
-        anaconda.setMethodstr(opts.method)
-    else:
-        anaconda.methodstr = None
+        anaconda.methodstr = opts.method
 
     if opts.stage2:
-        if opts.stage2[0] == '@':
-            opts.stage2 = expandFTPMethod(opts.stage2)
-
         anaconda.stage2 = opts.stage2
 
     if opts.noverifyssl:
diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index 5f2ccbe..4c39841 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -237,21 +237,6 @@ class Anaconda(object):
         f.write('Section "Device"\n\tIdentifier "Videocard0"\n\tDriver "%s"\nEndSection\n' % self.xdriver)
         f.close()
 
-    def setMethodstr(self, methodstr):
-        if methodstr.startswith("cdrom://"):
-            (device, tree) = string.split(methodstr[8:], ":", 1)
-
-            if not tree.startswith("/"):
-                tree = "/%s" %(tree,)
-
-            if device.startswith("/dev/"):
-                device = device[5:]
-
-            self.mediaDevice = device
-            self.methodstr = "cdrom://%s" % tree
-        else:
-            self.methodstr = methodstr
-
     def write(self):
         import network
         self.writeXdriver()
-- 
1.7.11.4



More information about the anaconda-patches mailing list