[sysadmin-bin] More fixages on the way



commit 26cc13400cf95576342efa1b67e9605e22693b0f
Author: Andrea Veri <av gnome org>
Date:   Sat Mar 22 00:16:27 2014 +0100

    More fixages on the way

 cleanup-accounts.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/cleanup-accounts.py b/cleanup-accounts.py
index 13293d0..7fe1d26 100755
--- a/cleanup-accounts.py
+++ b/cleanup-accounts.py
@@ -9,7 +9,8 @@ import ldap.filter
 LDAP_USER_BASE='ou=people,dc=gnome,dc=org'
 LDAP_GROUP_BASE='ou=groups,dc=gnome,dc=org'
 
-repositories = os.listdir('/git')
+infrastructure_folders = 'archive', 'cgit', 'empty-description', 'repositories.txt', 'repositories.doap'
+repositories = filter( lambda f: not f.startswith(infrastructure_folders), os.listdir('/git'))
 last_pushed_times = {}
 
 file = open('/home/admin/secret/ldap','r')
@@ -26,8 +27,7 @@ for line in lines:
 file.close()
 
 for repository in repositories:
-    os.chdir('/git/%s' % repository)
-    pushlog = open('gnome_pushlog', 'r')
+    pushlog = open('/git/%s/gnome_pushlog' % repository, 'r')
     for line in pushlog.readlines():
         fields = line.rstrip().split('\t')
         username = fields[3]
@@ -78,6 +78,8 @@ def get_uids_from_group(group):
     people.discard('otaylor')
     people.discard('av')
 
+    return people
+
 gnomecvs_users = (get_uids_from_group('gnomecvs'))
 ftpbasic_users = (get_uids_from_group('ftpbasic'))
 


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