[PATCH 3/4] findFirstIsoImage needs to return a filename, so fix it.

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

 



It was previously returning a closed filehandle due to reuse of the "f"
variable.
---
 pyanaconda/image.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index 180ac7f..90a264b 100644
--- a/pyanaconda/image.py
+++ b/pyanaconda/image.py
@@ -34,8 +34,8 @@ def findFirstIsoImage(path, messageWindow):
     files = os.listdir(path)
     arch = _arch
 
-    for f in files:
-        what = path + '/' + f
+    for fn in files:
+        what = path + '/' + fn
         log.debug("Checking %s" % (what))
         if not isys.isIsoImage(what):
             continue
@@ -78,16 +78,16 @@ def findFirstIsoImage(path, messageWindow):
                    "\n\n"
                    "It is recommended that you exit and abort your "
                    "installation, but you can choose to continue if "
-                   "you think this is in error.") % (f,),
+                   "you think this is in error.") % (fn,),
                    type="custom", custom_icon="warning",
                    custom_buttons= [_("_Exit installer"),
                                     _("_Continue")])
             if rc == 0:
                 sys.exit(0)
 
-        log.info("Found disc at %s" % f)
+        log.info("Found disc at %s" % fn)
         isys.umount("/mnt/install/cdimage", removeDir=False)
-        return f
+        return fn
 
     return None
 
-- 
1.7.4.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