[sysadmin-bin] Safe to check whether provider is ldapmain
- From: Andrea Veri <av src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Safe to check whether provider is ldapmain
- Date: Fri, 17 Nov 2017 12:48:03 +0000 (UTC)
commit 8a1f4285f139b05b482e930a628f6465ba094488
Author: Andrea Veri <averi redhat com>
Date: Fri Nov 17 13:46:51 2017 +0100
Safe to check whether provider is ldapmain
gitlab/fetch-username.py | 6 +++---
gitlab/gitlab-operations.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gitlab/fetch-username.py b/gitlab/fetch-username.py
index c30cfa1..51a945b 100755
--- a/gitlab/fetch-username.py
+++ b/gitlab/fetch-username.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
import gitlab
-import os
+import os
execfile('/home/admin/secret/gitlab_ro')
@@ -9,7 +9,7 @@ gl = gitlab.Gitlab('https://gitlab.gnome.org', GITLAB_PRIVATE_RO_TOKEN, api_vers
def fetch_username():
- user = os.environ['GL_USERNAME']
+ user = os.environ['GL_USERNAME']
user = gl.users.list(username='%s' % user)
user = user[0]
@@ -17,7 +17,7 @@ def fetch_username():
if len(user.attributes['identities']) > 0:
for index, _ in enumerate(user.attributes['identities']):
provider = user.attributes['identities'][index]['provider']
- if provider not in ('google_oauth2', 'github', 'gitlab'):
+ if provider == 'ldapmain':
username = user.attributes['identities'][index]['extern_uid'].split(',')[0].replace('uid=', '')
identity_found = True
diff --git a/gitlab/gitlab-operations.py b/gitlab/gitlab-operations.py
index 8b76ea1..35de197 100755
--- a/gitlab/gitlab-operations.py
+++ b/gitlab/gitlab-operations.py
@@ -133,7 +133,7 @@ for project in maints:
if len(user.attributes['identities']) > 0:
for index, _ in enumerate(user.attributes['identities']):
provider = user.attributes['identities'][index]['provider']
- if provider not in ('google_oauth2', 'github', 'gitlab'):
+ if provider == 'ldapmain':
members_dict[user.attributes['identities'][index]['extern_uid'].split(',')[0].replace('uid=', '')] =
user.attributes['id']
identity_found = True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]