Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #6130/c077818c backport][stable-6] Fixes #6112: community.general.gitlab_runner KeyError: 'access_level' #6142

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- gitlab_runner - fix ``KeyError`` on runner creation and update (https://github.com/ansible-collections/community.general/issues/6112).
5 changes: 2 additions & 3 deletions plugins/modules/gitlab_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,8 @@ def create_or_update_runner(self, description, options):
'maximum_timeout': options['maximum_timeout'],
'tag_list': options['tag_list'],
}
if arguments['access_level'] is not None:
if options.get('access_level') is not None:
arguments['access_level'] = options['access_level']

# Because we have already call userExists in main()
if self.runner_object is None:
arguments['description'] = description
Expand All @@ -251,7 +250,7 @@ def create_or_update_runner(self, description, options):
access_level_on_creation = False

if not access_level_on_creation:
del arguments['access_level']
arguments.pop('access_level', None)

runner = self.create_runner(arguments)
changed = True
Expand Down