mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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:
parent
97c01174a2
commit
da2dfd0706
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue