mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
[PR #8876/6af74d1b backport][stable-9] multiple modules: improve dict.items() loops (#8882)
multiple modules: improve dict.items() loops (#8876)
* multiple modules: improve dict.items() loops
* simplify in memset_* modules
* add changelog frag
(cherry picked from commit 6af74d1ba6
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
e6edf9cdea
commit
53a941cee7
16 changed files with 44 additions and 43 deletions
|
@ -196,9 +196,9 @@ class GitLabDeployKey(object):
|
|||
changed = False
|
||||
|
||||
for arg_key, arg_value in arguments.items():
|
||||
if arguments[arg_key] is not None:
|
||||
if getattr(deploy_key, arg_key) != arguments[arg_key]:
|
||||
setattr(deploy_key, arg_key, arguments[arg_key])
|
||||
if arg_value is not None:
|
||||
if getattr(deploy_key, arg_key) != arg_value:
|
||||
setattr(deploy_key, arg_key, arg_value)
|
||||
changed = True
|
||||
|
||||
return (changed, deploy_key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue