mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00: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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user