mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-25 13:34:01 -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
|
|
@ -264,14 +264,14 @@ class GitlabIssue(object):
|
|||
|
||||
if key == 'milestone_id':
|
||||
old_milestone = getattr(issue, 'milestone')['id'] if getattr(issue, 'milestone') else ""
|
||||
if options[key] != old_milestone:
|
||||
if value != old_milestone:
|
||||
return True
|
||||
elif key == 'assignee_ids':
|
||||
if options[key] != sorted([user["id"] for user in getattr(issue, 'assignees')]):
|
||||
if value != sorted([user["id"] for user in getattr(issue, 'assignees')]):
|
||||
return True
|
||||
|
||||
elif key == 'labels':
|
||||
if options[key] != sorted(getattr(issue, key)):
|
||||
if value != sorted(getattr(issue, key)):
|
||||
return True
|
||||
|
||||
elif getattr(issue, key) != value:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue