Skip to content

Commit

Permalink
grouper_admin.create_groups: Allow of str input #72
Browse files Browse the repository at this point in the history
  • Loading branch information
astrochun committed Oct 5, 2020
1 parent 3def1a5 commit e3ca412
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions requiam/grouper_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ def create_groups(groups, group_type, group_descriptions, grouper_api, log0=None
Process through a list of Grouper groups and add them if they don't exist
and set permissions
:param groups: list of str containing group names
:param groups: str or list of str containing group names
:param group_type: str. Either 'portal', 'quota', or 'test'
:param group_descriptions: list of str containing description
:param group_descriptions: str or list of str containing description
:param grouper_api: GrouperAPI object
:param log0: logging.getLogger() object
:param add: boolean. Indicate whether to perform update or dry run
Expand All @@ -276,6 +276,11 @@ def create_groups(groups, group_type, group_descriptions, grouper_api, log0=None
if isinstance(log0, type(None)):
log0 = log_stdout()

if isinstance(groups, str):
groups = [groups]
if isinstance(group_descriptions, str):
group_descriptions = [group_descriptions]

for group, description in zip(groups, group_descriptions):
add_dict = {'group': group,
'group_type': group_type,
Expand Down

0 comments on commit e3ca412

Please sign in to comment.