changeset 2962:c400f2fbf131 beta

cleanup script walks recursive on dirs to find repos to cleanup
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 26 Oct 2012 00:25:21 +0200
parents 08f89c688592
children 742d1b8ca263
files rhodecode/lib/cleanup.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/cleanup.py	Fri Oct 26 00:13:55 2012 +0200
+++ b/rhodecode/lib/cleanup.py	Fri Oct 26 00:25:21 2012 +0200
@@ -88,9 +88,10 @@
 
         repos_location = RhodeCodeUi.get_repos_location()
         to_remove = []
-        for loc in os.listdir(repos_location):
-            if REMOVED_REPO_PAT.match(loc):
-                to_remove.append([loc, self._extract_date(loc)])
+        for dn, dirs, f in os.walk(str(repos_location)):
+            for loc in dirs:
+                if REMOVED_REPO_PAT.match(loc):
+                    to_remove.append([loc, self._extract_date(loc)])
 
         #filter older than (if present)!
         now = datetime.datetime.now()