mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-22 05:09:12 +00:00
[PR #11215/862fe79a backport][stable-12] fix ruff case SIM110 (#11217)
fix ruff case SIM110 (#11215)
* fix ruff case SIM110
* Update plugins/module_utils/xenserver.py
* add changelog frag
---------
(cherry picked from commit 862fe79a22)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
e741e22ec4
commit
8930d03c7c
16 changed files with 34 additions and 72 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue