diff --git a/lib/ansible/modules/extras/network/nmcli.py b/lib/ansible/modules/extras/network/nmcli.py index 64ee02b09c5..7dfe28288b1 100644 --- a/lib/ansible/modules/extras/network/nmcli.py +++ b/lib/ansible/modules/extras/network/nmcli.py @@ -395,6 +395,9 @@ try: except ImportError: pass +from ansible.module_utils.basic import AnsibleModule + + class Nmcli(object): """ This is the generic nmcli manipulation class that is subclassed based on platform. @@ -490,7 +493,7 @@ class Nmcli(object): for setting in secrets: for key in secrets[setting]: config[setting_name][key]=secrets[setting][key] - except Exception, e: + except Exception as e: pass def dict_to_string(self, d): @@ -1080,7 +1083,4 @@ def main(): module.exit_json(**result) -# import module snippets -from ansible.module_utils.basic import * - main() diff --git a/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python24.txt b/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python24.txt index 71c769c8b9b..cf392501c6f 100644 --- a/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python24.txt +++ b/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python24.txt @@ -13,3 +13,4 @@ /univention/ /web_infrastructure/letsencrypt.py /infrastructure/foreman/ +/network/nmcli.py diff --git a/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python3.txt b/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python3.txt index 4831e17134a..314b5c1f704 100644 --- a/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python3.txt +++ b/lib/ansible/modules/extras/test/utils/shippable/sanity-skip-python3.txt @@ -50,4 +50,3 @@ /network/cloudflare_dns.py /network/f5/bigip_gtm_virtual_server.py /network/f5/bigip_gtm_wide_ip.py -/network/nmcli.py