mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-18 16:31:26 -07:00
multiple modules: improve dict.items() loops (#8876)
* multiple modules: improve dict.items() loops * simplify in memset_* modules * add changelog frag
This commit is contained in:
parent
80f48cceb4
commit
6af74d1ba6
16 changed files with 44 additions and 43 deletions
|
@ -368,18 +368,18 @@ class GitLabRunner(object):
|
|||
changed = False
|
||||
|
||||
for arg_key, arg_value in arguments.items():
|
||||
if arguments[arg_key] is not None:
|
||||
if isinstance(arguments[arg_key], list):
|
||||
if arg_value is not None:
|
||||
if isinstance(arg_value, list):
|
||||
list1 = getattr(runner, arg_key)
|
||||
list1.sort()
|
||||
list2 = arguments[arg_key]
|
||||
list2 = arg_value
|
||||
list2.sort()
|
||||
if list1 != list2:
|
||||
setattr(runner, arg_key, arguments[arg_key])
|
||||
setattr(runner, arg_key, arg_value)
|
||||
changed = True
|
||||
else:
|
||||
if getattr(runner, arg_key) != arguments[arg_key]:
|
||||
setattr(runner, arg_key, arguments[arg_key])
|
||||
if getattr(runner, arg_key) != arg_value:
|
||||
setattr(runner, arg_key, arg_value)
|
||||
changed = True
|
||||
|
||||
return (changed, runner)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue