diff options
| author | Mateusz Filipowicz <mateusz.filipowicz@roche.com> | 2020-02-05 14:10:35 +0100 | 
|---|---|---|
| committer | Mateusz Filipowicz <mateusz.filipowicz@roche.com> | 2020-02-07 11:00:18 +0100 | 
| commit | 7f192b4f8734e29a63f1c79be322c25d45cfe23f (patch) | |
| tree | 838b4da28adc4191e15cef621373ef9341020e44 /gitlab | |
| parent | 8287a0d993a63501fc859702fc8079a462daa1bb (diff) | |
| download | gitlab-7f192b4f8734e29a63f1c79be322c25d45cfe23f.tar.gz | |
feat: add capability to control GitLab features per project or group
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/v4/objects.py | 21 | 
1 files changed, 19 insertions, 2 deletions
| diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index b0e686d..f18f733 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -724,7 +724,16 @@ class FeatureManager(ListMixin, DeleteMixin, RESTManager):      _obj_cls = Feature      @exc.on_http_error(exc.GitlabSetError) -    def set(self, name, value, feature_group=None, user=None, **kwargs): +    def set( +        self, +        name, +        value, +        feature_group=None, +        user=None, +        group=None, +        project=None, +        **kwargs +    ):          """Create or update the object.          Args: @@ -732,6 +741,8 @@ class FeatureManager(ListMixin, DeleteMixin, RESTManager):              value (bool/int): The value to set for the object              feature_group (str): A feature group name              user (str): A GitLab username +            group (str): A GitLab group +            project (str): A GitLab project in form group/project              **kwargs: Extra options to send to the server (e.g. sudo)          Raises: @@ -742,7 +753,13 @@ class FeatureManager(ListMixin, DeleteMixin, RESTManager):              obj: The created/updated attribute          """          path = "%s/%s" % (self.path, name.replace("/", "%2F")) -        data = {"value": value, "feature_group": feature_group, "user": user} +        data = { +            "value": value, +            "feature_group": feature_group, +            "user": user, +            "group": group, +            "project": project, +        }          server_data = self.gitlab.http_post(path, post_data=data, **kwargs)          return self._obj_cls(self, server_data) | 
