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

mock ChangeLog,1.3,1.4 mock.py,1.11,1.12



Author: dcbw

Update of /cvs/fedora/mock
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5041

Modified Files:
	ChangeLog mock.py 
Log Message:
2005-06-21 10:02  dcbw

    * mock.py:
    Fix traceback in clean() when self.basedir doesn't
        yet exist.
    Fix traceback when call to Root() raises an exception
        and doesn't therefore set 'my'




Index: ChangeLog
===================================================================
RCS file: /cvs/fedora/mock/ChangeLog,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ChangeLog	21 Jun 2005 13:47:33 -0000	1.3
+++ ChangeLog	21 Jun 2005 14:11:17 -0000	1.4
@@ -1,3 +1,11 @@
+2005-06-21 10:02  dcbw
+
+    * mock.py:
+    Fix traceback in clean() when self.basedir doesn't
+        yet exist.
+    Fix traceback when call to Root() raises an exception
+        and doesn't therefore set 'my'
+
 2005-06-11 23:56  skvidal
 
 	* mock.py: 


Index: mock.py
===================================================================
RCS file: /cvs/fedora/mock/mock.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- mock.py	21 Jun 2005 13:47:33 -0000	1.11
+++ mock.py	21 Jun 2005 14:11:17 -0000	1.12
@@ -125,13 +125,14 @@
         if os.path.exists('%s/%s' % (self.rootdir, 'dev/pts')):
             self._umount('dev/pts')
             
-        cmd = '%s -rfv %s' % (self.config['rm'], self.basedir)
-        (retval, output) = self.do(cmd)
-
-        if retval != 0:
-            error("Errors cleaning out chroot: %s" % output)
-            if os.path.exists(self.rootdir) or os.path.exists(self.statedir):
-                raise Error, "Failed to clean basedir, exiting"
+        if os.path.exists(self.basedir)
+            cmd = '%s -rfv %s' % (self.config['rm'], self.basedir)
+            (retval, output) = self.do(cmd)
+
+            if retval != 0:
+                error("Errors cleaning out chroot: %s" % output)
+                if os.path.exists(self.rootdir) or os.path.exists(self.statedir):
+                    raise Error, "Failed to clean basedir, exiting"
 
 
     def state(self, curstate=None):
@@ -688,12 +689,14 @@
 
 
     try:
+        my = None  # if Root() fails, my will be undefined so we force it to None
         my = Root(config_opts)
         my.prep()
         my.build(srpm)
     except Error, e:
         print e
-        my.close()
+        if my:
+            my.close()
         sys.exit(100)
 
     my.close()


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