[PATCH] Remove temporary treeinfo files from /var/tmp

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

 



# HG changeset patch
# User Mark McLoughlin <markmc@xxxxxxxxxx>
# Date 1208962770 -3600
# Node ID c7e565fa0b688738b9c077c4349e427501c31811
# Parent  c54605ffcd7b4356b2c02c85bb2c4413eae6fa53
Remove temporary treeinfo files from /var/tmp

Signed-off-by: Mark McLoughlin <markmc@xxxxxxxxxx>

diff -r c54605ffcd7b -r c7e565fa0b68 virtinst/OSDistro.py
--- a/virtinst/OSDistro.py	Mon Apr 21 18:07:25 2008 -0400
+++ b/virtinst/OSDistro.py	Wed Apr 23 15:59:30 2008 +0100
@@ -56,17 +56,22 @@ class RedHatDistro(Distro):
 
     def hasTreeinfo(self, fetcher, progresscb):
         # all Red Hat based distros should have .treeinfo / execute only once
-        if (self.treeinfo is None):
-            if fetcher.hasFile(".treeinfo"):
-                logging.debug("Detected .treeinfo file")
-                tmptreeinfo = fetcher.acquireFile(".treeinfo", progresscb)
-                self.treeinfo = ConfigParser.SafeConfigParser()
-                self.treeinfo.read(tmptreeinfo)
-                return True
-            else:
-                return False
-        else:
+        if not (self.treeinfo is None):
             return True
+
+        if not fetcher.hasFile(".treeinfo"):
+            return False
+
+        logging.debug("Detected .treeinfo file")
+
+        tmptreeinfo = fetcher.acquireFile(".treeinfo", progresscb)
+        try:
+            self.treeinfo = ConfigParser.SafeConfigParser()
+            self.treeinfo.read(tmptreeinfo)
+        finally:
+            os.unlink(tmptreeinfo)
+
+        return True
 
     def acquireKernel(self, fetcher, progresscb):
         if self.hasTreeinfo(fetcher, progresscb):

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux