modules: update code to python3 (#10904)
Some checks failed
EOL CI / EOL Sanity (Ⓐ2.17) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.17+py3.10) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.17+py3.12) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.17+py3.7) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.17+alpine319+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.17+alpine319+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.17+alpine319+py:azp/posix/3/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.17+fedora39+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.17+fedora39+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.17+fedora39+py:azp/posix/3/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.17+ubuntu2004+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.17+ubuntu2004+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.17+ubuntu2004+py:azp/posix/3/) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled

* modules: update code to python3

* pamd: rollback changes

* add changelog frag

* fix/improve assignments using generators

* Update plugins/modules/launchd.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Alexei Znamensky 2025-10-14 08:42:48 +13:00 committed by GitHub
commit 3b83df3f79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 113 additions and 86 deletions

View file

@ -376,13 +376,13 @@ def response_to_hash(module, response):
This is for doing comparisons with Ansible's current parameters.
"""
return {
u'id': response.get(u'id'),
u'name': response.get(u'name'),
u'cidr': response.get(u'cidr'),
u'status': response.get(u'status'),
u'routes': VpcRoutesArray(
response.get(u'routes', []), module).from_response(),
u'enable_shared_snat': response.get(u'enable_shared_snat')
'id': response.get('id'),
'name': response.get('name'),
'cidr': response.get('cidr'),
'status': response.get('status'),
'routes': VpcRoutesArray(
response.get('routes', []), module).from_response(),
'enable_shared_snat': response.get('enable_shared_snat')
}
@ -480,14 +480,14 @@ class VpcRoutesArray(object):
def _request_for_item(self, item):
return {
u'destination': item.get('destination'),
u'nexthop': item.get('next_hop')
'destination': item.get('destination'),
'nexthop': item.get('next_hop')
}
def _response_from_item(self, item):
return {
u'destination': item.get(u'destination'),
u'next_hop': item.get(u'nexthop')
'destination': item.get('destination'),
'next_hop': item.get('nexthop')
}