mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-31 07:43:09 +00:00
gitlab_hook: use None for non-existent attr in gitlab API response (#4668)
* gitlab_hook: use empty string for non-existent attr in gitlab API response; * gitlab_hook: use None for non-existent attr in gitlab API response; * gitlab_hook: use None for non-existent attr in gitlab API response - add changelog fragment; * gitlab_hook: update changelog fragment for #4668 * Update changelogs/fragments/4668-gitlab_hook-use-None-for-non-existent-attr.yml Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- gitlab_hook - avoid errors during idempotency check when an attribute does not exist (https://github.com/ansible-collections/community.general/pull/4668).
|
||||
@@ -257,7 +257,7 @@ class GitLabHook(object):
|
||||
|
||||
for arg_key, arg_value in arguments.items():
|
||||
if arguments[arg_key] is not None:
|
||||
if getattr(hook, arg_key) != arguments[arg_key]:
|
||||
if getattr(hook, arg_key, None) != arguments[arg_key]:
|
||||
setattr(hook, arg_key, arguments[arg_key])
|
||||
changed = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user