mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
update code to python3 (#10903)
* update code to python3 * add changelog frag * rollback adjustment for plugins/lookup/lmdb_kv.py * accept PR suggestion for plugins/module_utils/utm_utils.py * accept PR suggestion for plugins/module_utils/vexata.py * Apply suggestions from code review * Update changelogs/fragments/10903-2to3.yml * Update changelogs/fragments/10903-2to3.yml
This commit is contained in:
@@ -139,14 +139,10 @@ from ansible_collections.community.general.plugins.plugin_utils.unsafe import ma
|
||||
|
||||
# xmlrpc
|
||||
try:
|
||||
import xmlrpclib as xmlrpc_client
|
||||
import xmlrpc.client as xmlrpc_client
|
||||
HAS_XMLRPC_CLIENT = True
|
||||
except ImportError:
|
||||
try:
|
||||
import xmlrpc.client as xmlrpc_client
|
||||
HAS_XMLRPC_CLIENT = True
|
||||
except ImportError:
|
||||
HAS_XMLRPC_CLIENT = False
|
||||
HAS_XMLRPC_CLIENT = False
|
||||
|
||||
|
||||
class TimeoutTransport (xmlrpc_client.SafeTransport):
|
||||
|
||||
@@ -167,13 +167,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||
|
||||
def _add_groups(self):
|
||||
"""Add Linode instance groups to the dynamic inventory."""
|
||||
self.linode_groups = set(
|
||||
filter(None, [
|
||||
instance.group
|
||||
for instance
|
||||
in self.instances
|
||||
])
|
||||
)
|
||||
self.linode_groups = {instance.group for instance in self.instances if instance.group}
|
||||
|
||||
for linode_group in self.linode_groups:
|
||||
self.inventory.add_group(linode_group)
|
||||
|
||||
Reference in New Issue
Block a user