Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Can't manage GitLab Group attributes : membership_lock or shared_runners_setting #1431

Closed
Labels
@Stan0304

Description

@Stan0304

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_lock

Specifications

  • 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp