[sysadmin-bin] Temp revert as the gitlab_ro file requires a sudoers rule in place to be read correctly
- From: Andrea Veri <av src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Temp revert as the gitlab_ro file requires a sudoers rule in place to be read correctly
- Date: Mon, 13 Nov 2017 17:30:56 +0000 (UTC)
commit f91b458d9e76a850f6bea6118e44da462922720d
Author: Andrea Veri <averi redhat com>
Date: Mon Nov 13 18:30:47 2017 +0100
Temp revert as the gitlab_ro file requires a sudoers rule in place to be read correctly
git/gnome-post-receive-email | 33 +++------------------------------
1 files changed, 3 insertions(+), 30 deletions(-)
---
diff --git a/git/gnome-post-receive-email b/git/gnome-post-receive-email
index 06e3c93..493106e 100755
--- a/git/gnome-post-receive-email
+++ b/git/gnome-post-receive-email
@@ -36,14 +36,6 @@ import sys
import socket
from email import Header
-
-if socket.gethostname() == 'gitlab.gnome.org':
- import gitlab
-
- execfile('/home/admin/secret/gitlab_ro')
-
- gl = gitlab.Gitlab('https://gitlab.gnome.org', GITLAB_PRIVATE_RO_TOKEN, api_version=4)
-
script_path = os.path.realpath(os.path.abspath(sys.argv[0]))
script_dir = os.path.dirname(script_path)
@@ -121,34 +113,15 @@ class RefChange(object):
raise NotImplementedError()
def generate_header(self, out, subject, include_revs=True, oldrev=None, newrev=None, cc=None):
- is_gitlab = False
-
- if socket.gethostname() == 'gitlab.gnome.org':
- is_gitlab = True
-
- user = os.environ['GL_USERNAME']
- user = gl.users.list(username='%s' % user)
- user = user[0]
-
- 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'):
- username =
user.attributes['identities'][index]['extern_uid'].split(',')[0].replace('uid=', '')
-
- user = username
- user_fullname = user.attributes['name']
+ if socket.gethostname() in ('gitlab.gnome.org', 'gitlab-test.gnome.org'):
+ user = 'gitlab'
else:
- global user_fullname
user = os.environ['USER']
if user_fullname:
from_address = "%s <%s src gnome org>" % (Header.Header(user_fullname.decode('utf-8')), user)
else:
- if is_gitlab:
- from_address = "%s <%s>" % (Header.Header(user.attributes['name'].decode('utf-8')),
user.attributes['email'])
- else:
- from_address = "%s src gnome org" % (user)
+ from_address = "%s src gnome org" % (user)
if cc is None:
cc = self.cc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]