mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
The fix ensures that no 'KeyError' is raised, when 'access_level' is not provided as module parameter or when 'access_level_on_creation' is false. Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de> Co-authored-by: Christoph Fiehe <c.fiehe@eurodata.de>
This commit is contained in:
parent
3d67f51824
commit
c077818c5d
2 changed files with 4 additions and 3 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- gitlab_runner - fix ``KeyError`` on runner creation and update (https://github.com/ansible-collections/community.general/issues/6112).
|
|
@ -234,9 +234,8 @@ class GitLabRunner(object):
|
||||||
'maximum_timeout': options['maximum_timeout'],
|
'maximum_timeout': options['maximum_timeout'],
|
||||||
'tag_list': options['tag_list'],
|
'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']
|
arguments['access_level'] = options['access_level']
|
||||||
|
|
||||||
# Because we have already call userExists in main()
|
# Because we have already call userExists in main()
|
||||||
if self.runner_object is None:
|
if self.runner_object is None:
|
||||||
arguments['description'] = description
|
arguments['description'] = description
|
||||||
|
@ -251,7 +250,7 @@ class GitLabRunner(object):
|
||||||
access_level_on_creation = False
|
access_level_on_creation = False
|
||||||
|
|
||||||
if not access_level_on_creation:
|
if not access_level_on_creation:
|
||||||
del arguments['access_level']
|
arguments.pop('access_level', None)
|
||||||
|
|
||||||
runner = self.create_runner(arguments)
|
runner = self.create_runner(arguments)
|
||||||
changed = True
|
changed = True
|
||||||
|
|
Loading…
Reference in a new issue