[sysadmin-bin] Make sure the cleanup LDAP accounts script can freely run on gitlab.g.o



commit ddd3387491be7a3d7c038f30d69a69e4117a6eb5
Author: Andrea Veri <averi redhat com>
Date:   Tue May 29 20:50:53 2018 +0200

    Make sure the cleanup LDAP accounts script can freely run on gitlab.g.o

 cleanup-inactive-ldap-accounts.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/cleanup-inactive-ldap-accounts.py b/cleanup-inactive-ldap-accounts.py
index 8660fa3..3ef69dd 100755
--- a/cleanup-inactive-ldap-accounts.py
+++ b/cleanup-inactive-ldap-accounts.py
@@ -17,6 +17,7 @@ from gnome_ldap_utils import *
 execfile('/home/admin/secret/freeipa')
 
 glu = Gnome_ldap_utils(LDAP_GROUP_BASE, LDAP_HOST, LDAP_USER_BASE, 'cn=Directory Manager', ldap_password)
+GL_PATH = '/var/opt/gitlab/git-data/repositories'
 
 parser = OptionParser()
 parser.add_option("--print-inactive-accounts", action="store_true", default=False,
@@ -27,12 +28,14 @@ parser.add_option("--verbose",
 
 (options, args) = parser.parse_args()
 
-if socket.gethostname() != 'git.gnome.org':
+if socket.gethostname() != 'gitlab.gnome.org':
     print ("You are not allowed to run this script on a different host than git.gnome.org, exiting...", 
end='\n')
     sys.exit(1)
 
-infrastructure_folders = 'archive', 'cgit', 'empty-description', 'repositories.txt', 'repositories.doap', 
'moved_to_gitlab'
-repositories = filter( lambda f: not f.startswith(infrastructure_folders), os.listdir('/git'))
+gnome_repositories = filter( lambda f: not f.endswith('wiki.git'), os.listdir('%s/GNOME' % GL_PATH))
+infra_repositories = filter( lambda f: not f.endswith('wiki.git'), os.listdir('%s/Infrastructure' % GL_PATH))
+repositories = gnome_repositories + infra_repositories
+
 last_pushed_times = {}
 
 


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