mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
[PR #6712/e85b0080 backport][stable-6] gitlab_group => Make most options optional (#6724)
gitlab_group => Make most options optional (#6712)
* Make most options optional as they should be
* Add filter to create_group instead
* Remove whitespace
* Add changelog fragment
* Added description and extension to fragment
* Update changelogs/fragments/6712-gitlab_group-filtered-for-none-values.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/gitlab_group.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Make Python 2.6 compatible.
* Another shot at compatibility.
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e85b008036)
Co-authored-by: Intellium <w.moeken@moeken.eu>
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- gitlab_group - the module passed parameters to the API call even when not set. The module is now filtering out ``None`` values to remediate this (https://github.com/ansible-collections/community.general/pull/6712).
|
||||||
@@ -255,7 +255,10 @@ class GitLabGroup(object):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
group = self._gitlab.groups.create(arguments)
|
# Filter out None values
|
||||||
|
filtered = dict((arg_key, arg_value) for arg_key, arg_value in arguments.items() if arg_value is not None)
|
||||||
|
|
||||||
|
group = self._gitlab.groups.create(filtered)
|
||||||
except (gitlab.exceptions.GitlabCreateError) as e:
|
except (gitlab.exceptions.GitlabCreateError) as e:
|
||||||
self._module.fail_json(msg="Failed to create group: %s " % to_native(e))
|
self._module.fail_json(msg="Failed to create group: %s " % to_native(e))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user