1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-14 16:05:04 +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

@ -269,11 +269,7 @@ class _DictComparison:
if set(dict1.keys()) != set(dict2.keys()):
return False
for k in dict1:
if not self._compare_value(dict1.get(k), dict2.get(k)):
return False
return True
return all(self._compare_value(dict1[k], dict2[k]) for k in dict1)
def _compare_lists(self, list1, list2):
"""Takes in two lists and compares them."""
@ -283,11 +279,7 @@ class _DictComparison:
if len(list1) != len(list2):
return False
for i in range(len(list1)):
if not self._compare_value(list1[i], list2[i]):
return False
return True
return all(self._compare_value(l1, l2) for l1, l2 in zip(list1, list2))
def _compare_value(self, value1, value2):
"""