1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-04 19:26:58 +00:00

fix ruff case SIM110 (#11215)

* fix ruff case SIM110

* Update plugins/module_utils/xenserver.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* add changelog frag

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Alexei Znamensky 2025-11-26 09:47:50 +13:00 committed by GitHub
parent d364e35423
commit 862fe79a22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 34 additions and 72 deletions

View file

@ -507,10 +507,7 @@ def is_dictionary_subset(sub, super_dict):
:param super_dict: super dictionary, for example resources_attr_value.
:return: True if sub is contained in super.
"""
for key in sub:
if sub[key] != super_dict[key]:
return False
return True
return all(sub[key] == super_dict[key] for key in sub)
def are_lists_equal(s, t):
@ -533,10 +530,7 @@ def are_lists_equal(s, t):
# `service_id` is provided by the user in the update call.
sorted_s = sort_list_of_dictionary(s)
sorted_t = sort_list_of_dictionary(t)
for index, d in enumerate(sorted_s):
if not is_dictionary_subset(d, sorted_t[index]):
return False
return True
return all(is_dictionary_subset(d, sorted_t[index]) for index, d in enumerate(sorted_s))
else:
# Handle lists of primitive types.
try: