[omd-commits] OMD Git: omd: omd: Fixed problem updating omd sites without tmpfs: Not removing

git version control git at mathias-kettner.de
Fri Apr 27 13:52:15 CEST 2012


Module:   omd
Branch:   master
Commit:   e0d3a12fbf42bb3b250948561ea1350a3f0cdaf4
URL:      http://omdistro.org/projects/omd/repository/revisions/e0d3a12fbf42bb3b250948561ea1350a3f0cdaf4

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Fri Apr 27 13:47:58 2012 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Fri Apr 27 13:47:58 2012 +0200

omd: Fixed problem updating omd sites without tmpfs: Not removing
     whole tmp/ directory but only the contents

---

 Changelog        |    3 +++
 packages/omd/omd |    5 ++++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Changelog b/Changelog
index bde67da..2255784 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,9 @@
 This file documents the revision history for the Open Monitoring Distribution
 
 0.56     not yet released
+          - omd:
+            - Fixed problem updating omd sites without tmpfs: Not removing
+              whole tmp/ directory but only the contents
           - RPMS: Not checking for removed version during pkg release update
                  (Does not mean omd version update.)
           - Mod-Gearman: Updated to version 1.2.8
diff --git a/packages/omd/omd b/packages/omd/omd
index b81a47e..55daae0 100644
--- a/packages/omd/omd
+++ b/packages/omd/omd
@@ -708,7 +708,7 @@ def unmount_tmpfs(sitename, output = True, kill = False):
             if output:
                 sys.stdout.write("Cleaning up temp filesystem...")
                 sys.stdout.flush()
-            delete_user_file(tmp)
+            delete_directory_contents(tmp)
             if output:
                 ok()
         return True
@@ -790,6 +790,9 @@ def delete_user_file(user_path):
     else:
         os.remove(user_path)
 
+def delete_directory_contents(d):
+    for f in os.listdir(d):
+        delete_user_file(d + '/' + f)
 
 def create_skeleton_file(skelbase, userbase, relpath, replacements):
     skel_path = skelbase + "/" + relpath



More information about the omd-commits mailing list