[PATCH 3/4] If path doesn't exist, don't traceback. Return None.

Chris Lumens clumens at redhat.com
Thu Dec 6 22:26:39 UTC 2012


---
 pyanaconda/image.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index 6f8cc5f..f18057e 100644
--- a/pyanaconda/image.py
+++ b/pyanaconda/image.py
@@ -38,7 +38,11 @@ def findFirstIsoImage(path):
 
     Returns the basename of the image
     """
-    flush = os.stat(path)
+    try:
+        flush = os.stat(path)
+    except OSError:
+        return None
+
     arch = _arch
 
     if os.path.isfile(path) and path.endswith(".iso"):
-- 
1.7.11.2



More information about the anaconda-patches mailing list