From e8255c70dd3801cc4964041e2f9443697bb263a0 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 07 2017 10:18:31 +0000 Subject: Adjust the generation of the configuration with the change made to groups This relies on https://pagure.io/pagure/pull-request/2403 which just got merged and simplify how the configuration of groups is handled. Fixes https://pagure.io/pagure-dist-git/issue/3 Signed-off-by: Pierre-Yves Chibon --- diff --git a/dist_git_auth.py b/dist_git_auth.py index 1fe27fa..428a955 100644 --- a/dist_git_auth.py +++ b/dist_git_auth.py @@ -66,7 +66,7 @@ class DistGitoliteAuth(Gitolite3Auth): """ A dist-git's gitolite authentication module. """ @classmethod - def _process_project(cls, project, config, groups, global_pr_only): + def _process_project(cls, project, config, global_pr_only): """ Generate the gitolite configuration for the specified project. :arg project: the project to generate the configuration for @@ -74,22 +74,15 @@ class DistGitoliteAuth(Gitolite3Auth): :arg config: a list containing the different lines of the configuration file :type config: list - :arg groups: a dictionary containing the group name as key and the - users member of the group as values - :type groups: dict(str: list) :arg global_pr_only: boolean on whether the pagure instance enforces the PR workflow only or not :type global_pr_only: bool - :return: a tuple containing the updated config and groups variables - :return type: tuple(list, dict(str: list)) + :return: the updated config + :return type: list """ _log.debug(' Processing project: %s', project.fullname) - for group in project.committer_groups: - if group.group_name not in groups: - groups[group.group_name] = [ - user.username for user in group.users] # Check if the project or the pagure instance enforce the PR # only development model. @@ -156,4 +149,4 @@ class DistGitoliteAuth(Gitolite3Auth): deploykey.id)) config.append('') - return (groups, config) + return config