Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit 20a3599d authored by Rob Carleski's avatar Rob Carleski 🇮🇸
Browse files

Add new members list to group_data.

parent 3d7b589c
......@@ -7,6 +7,7 @@ import time
from urllib.parse import quote
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
from ldap3.utils.dn import parse_dn
class Client:
......@@ -152,7 +153,7 @@ class Client:
if item['naming'].lower() == name.lower():
return item['dn'].lower()
elif item['group']:
hname = re.sub('[\._]', ' ', name).lower()
hname = re.sub(r'[\._]', ' ', name).lower()
if item['displayName'].lower() == hname:
return item['dn'].lower()
......@@ -230,6 +231,17 @@ class Client:
if r.status_code ==
if 'umichgroup' in r.json()['group'][0]['objectClass']:
self.group_data = r.json()['group'][0]
self.group_data['members'] = []
if isinstance(self.group_data['memberDn'], list):
for member in self.group_data['memberDn']:
  • If you like, you can do for member in self.group_data['memberDn'] or []: instead of checking whether it's a list first.

    Or if you really wanted to golf it:

    self.group_data['members'].extend([parse_dn(x)[0][1] for x in self.group_data['memberDn'] or []])
Please register or sign in to reply
if isinstance(self.group_data['memberGroupDn'], list):
for member in self.group_data['memberGroupDn']:
raise ValueError('{} is not a group. Got [{}]'.format(
......@@ -361,7 +373,7 @@ class Client:
name = self._validate_name(name)
endpoint = self.call_url + '/reserve'
data = {
'name': re.sub('[\._]', ' ', name)
'name': re.sub(r'[\._]', ' ', name)
for x in range(int(self.retries)):
......@@ -29,6 +29,7 @@ setup(
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment