* 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>
(cherry picked from commit da2dfd0706
)
Co-authored-by: Kirill Petrov <crw.inbox@gmail.com>
pull/4684/head
parent
ae94c11a78
commit
c23dbb83d0
|
@ -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 New Issue