[virt-tools-list] [virtinst: PATCH] setup.py: Build _config.py if missing

Michal Privoznik mprivozn at redhat.com
Mon Aug 1 15:01:23 UTC 2011


Commit c81dd1c081a55fa13a54494094f801682191e948 introduced regression.
When _config.py does not exists, we end up trying to read non-existing
file and hence exception.
---
I am not signed into list, so please keep me CC'ed.

 AUTHORS  |    1 +
 setup.py |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 3eff259..63dfa3c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -51,6 +51,7 @@ Patches also received from
     Roopa Prabhu <roprabhu-at-cisco-dot-com>
     Andres Rodriguez <andreserl-at-ubuntu-dot-com>
     Hajime Taira <htaira-at-redhat-dot-com>
+    Michal Prívozník <mprivozn-at-redhat-dot-com>
 
     ...send patches and get your name here...
 
diff --git a/setup.py b/setup.py
index a690219..5c80b85 100755
--- a/setup.py
+++ b/setup.py
@@ -330,9 +330,12 @@ class mybuild(build):
         print "RHEL6 defaults       : %s" % bool(self.rhel6defaults)
 
         for f in config_files:
-            origconfig = file(f).read()
-            if origconfig == config_data:
-                continue
+            try:
+                origconfig = file(f).read()
+                if origconfig == config_data:
+                    continue
+            except IOError:
+                pass
 
             print "Generating %s" % f
             fd = open(f, "w")
-- 
1.7.3.4




More information about the virt-tools-list mailing list