module utils: update code to python3 (#10907)

* module utils: update code to python3

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-10-12 00:42:11 +13:00 committed by GitHub
commit cc83188594
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 83 additions and 77 deletions

View file

@ -183,7 +183,7 @@ class UTM:
result = None
if response is not None:
results = json.loads(response.read())
result = next(iter(filter(lambda d: d['name'] == module.params.get('name'), results)), None)
result = next(iter([d for d in results if d['name'] == module.params.get('name')]), None)
return info, result
def _clean_result(self, result):