[sysadmin-bin] restrict maintainers to members of the gnomecvs group
- From: Olav Vitters <ovitters src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] restrict maintainers to members of the gnomecvs group
- Date: Wed, 21 Jan 2015 09:04:26 +0000 (UTC)
commit 8d2bce452d6753b12909baf5a91b522ea1a085f1
Author: Olav Vitters <olav vitters nl>
Date: Wed Jan 21 10:04:17 2015 +0100
restrict maintainers to members of the gnomecvs group
ftpadmin | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/ftpadmin b/ftpadmin
index 7510646..e5f5d03 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -31,7 +31,6 @@ except ImportError:
import urlparse
import urllib2
-import grp
script_path = os.path.realpath(os.path.abspath(sys.argv[0]))
script_dir = os.path.dirname(script_path) + '/git'
@@ -52,7 +51,6 @@ if os.environ['USER'] != 'ovitters':
DEBUG=False
GROUP='ftpadmin'
-LDAP_BASE='ou=modules,dc=gnome,dc=org'
re_file =
re.compile(r'^(?P<module>.*?)[_-](?:(?P<oldversion>([0-9]+[\.])*[0-9]+)-)?(?P<version>([0-9]+[\.\-])*[0-9]+)\.(?P<format>(?:tar\.|diff\.)?[a-z][a-z0-9]*)$')
re_majmin = re.compile(r'^([0-9]+\.[0-9]+).*')
re_version = re.compile(r'([-.]|\d+|[^-.\d]+)')
@@ -301,6 +299,8 @@ class DOAP(BasicInfo):
DOAP_CACHE = '/ftp/cache/doap.json'
GNOME_REPO = 'git://git.gnome.org/'
+ GROUP_VCS='gnomecvs'
+
TARBALL_PATH_PREFIX = '/sources/'
TARBALL_HOSTNAME_SUFFIX = '.gnome.org'
@@ -336,9 +336,6 @@ class DOAP(BasicInfo):
last_modified = None
# XXX - unfinished
- #valid_uids = set(grp.getgrnam('olav').gr_mem)
- # XXX
- # XXX - unfinished
if not os.path.exists(self.jsonfile):
force_refresh = True
@@ -881,10 +878,6 @@ class SuiteInfo(DirectoryInfo):
class ModuleInfo(DirectoryInfo):
- DOAP = "http://usefulinc.com/ns/doap#"
- FOAF = "http://xmlns.com/foaf/0.1/"
- GNOME = "http://api.gnome.org/doap-extensions#"
-
def __init__(self, module, section=DEFAULT_SECTION):
self.module = module
self.section = section
@@ -894,16 +887,23 @@ class ModuleInfo(DirectoryInfo):
def _set_doap(self):
# Determine maintainers and module name
+
+ # single instance
doap = DOAP()
self.__class__._doap = doap
- self._maintainers = []
- self._reponame = self.module
-
+ # get_from_doap relies on self._reponame being set
self._reponame = doap.get_module(self.module)
- # XXX - restrict to gnomecvs users
- self._maintainers = doap.info.get(self._reponame, {}).get('maintainers', [])
+ # Limit maintainers to anyone being a member of GROUP_VCS
+ maints = set(self.get_from_doap('maintainers', []))
+ if maints:
+ try:
+ maints = set(grp.getgrnam(self.GROUP_VCS).gr_mem).intersection(maints)
+ except KeyError:
+ maints = set()
+
+ self._maintainers = maints
@property
def maintainers(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]