- Notifications
You must be signed in to change notification settings - Fork674
Closed
Labels
Description
Description of the problem, including code/CLI snippet
I tried to update a GitLab group and I can't update or even read the following attributes even if those settings exists on the API side (https://docs.gitlab.com/ee/api/groups.html#update-group):
- membership_lock
- shared_runners_setting
Bellow the code to reproduce the error.
#!/usr/bin/env python3importgitlabimportosgl=gitlab.Gitlab('https://gitlab.com',private_token=os.environ['GITLAB_TOKEN'])gl.auth()# Load a gitlab groupgroup_id=123456# TODO use an existing group_id heregitlab_group=gl.groups.get(group_id)# show the request_access_enabled -> that call is OKprint('request_access_enabled',gitlab_group.request_access_enabled)# show the membership_lock -> that call is NOT OKprint('membership_lock',gitlab_group.membership_lock)# show the shared_runners_setting -> that call is NOT OKprint('shared_runners_setting',gitlab_group.shared_runners_setting)
Themembership_lock attribute seems to be implemented, but theshared_runners_setting does not appear at all.
Expected Behavior
Having the ability to read and/or update themembership_lock andshared_runners_setting attributes of GitLab groups.
Actual Behavior
Actually when I try to read themembership_lock orshared_runners_setting, I get aAttributeError
request_access_enabled False # <- the first call that worksTraceback (most recent call last): File "/home/speyssard/.local/lib/python3.6/site-packages/gitlab/base.py", line 77, in __getattr__ return self.__dict__["_updated_attrs"][name]KeyError: 'membership_lock'During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/home/speyssard/.local/lib/python3.6/site-packages/gitlab/base.py", line 80, in __getattr__ value = self.__dict__["_attrs"][name]KeyError: 'membership_lock'During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/home/speyssard/.local/lib/python3.6/site-packages/gitlab/base.py", line 100, in __getattr__ return self.__dict__["_parent_attrs"][name]KeyError: 'membership_lock'During handling of the above exception, another exception occurred:Traceback (most recent call last): File "test.py", line 16, in <module> print('membership_lock', gitlab_group.membership_lock) File "/home/speyssard/.local/lib/python3.6/site-packages/gitlab/base.py", line 102, in __getattr__ raise AttributeError(name)AttributeError: membership_lockSpecifications
- python-gitlab version: 2.7.1 (and 2.5.0)
- API version you are using (v3/v4): v4
- Gitlab server version (or gitlab.com): 13.9.4-ee (not tested on gitlab.com but on a private gitlab server)