From fd1263c9aaa20e0a18823aab3ca7167bedca2715 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 12 Aug 2022 08:34:51 +0200 Subject: [PATCH] Fix some new linting errors (#499) * Fix some new linting errors. * More linting errors. ci_complete --- plugins/module_utils/acme/acme.py | 1 + plugins/plugin_utils/action_module.py | 6 +++--- tests/ee/roles/smoke/library/smoke_ipaddress.py | 1 + tests/ee/roles/smoke/library/smoke_pyyaml.py | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/module_utils/acme/acme.py b/plugins/module_utils/acme/acme.py index ed9b457b..8dc2796b 100644 --- a/plugins/module_utils/acme/acme.py +++ b/plugins/module_utils/acme/acme.py @@ -48,6 +48,7 @@ except ImportError: IPADDRESS_IMPORT_ERROR = traceback.format_exc() else: HAS_IPADDRESS = True + IPADDRESS_IMPORT_ERROR = None def _assert_fetch_url_success(module, response, info, allow_redirect=False, allow_client_error=True, allow_server_error=True): diff --git a/plugins/plugin_utils/action_module.py b/plugins/plugin_utils/action_module.py index c04a67bd..c802e7de 100644 --- a/plugins/plugin_utils/action_module.py +++ b/plugins/plugin_utils/action_module.py @@ -217,7 +217,7 @@ class AnsibleActionModule(object): # this uses exceptions as it happens before we can safely call fail_json alias_warnings = [] - alias_results, self._legal_inputs = handle_aliases(spec, param, alias_warnings=alias_warnings) + alias_results, self._legal_inputs = handle_aliases(spec, param, alias_warnings=alias_warnings) # pylint: disable=used-before-assignment for option, alias in alias_warnings: self.warn('Both option %s and its alias %s are set.' % (option_prefix + option, option_prefix + alias)) @@ -241,12 +241,12 @@ class AnsibleActionModule(object): param = self.params try: - self.no_log_values.update(list_no_log_values(spec, param)) + self.no_log_values.update(list_no_log_values(spec, param)) # pylint: disable=used-before-assignment except TypeError as te: self.fail_json(msg="Failure when processing no_log parameters. Module invocation will be hidden. " "%s" % to_native(te), invocation={'module_args': 'HIDDEN DUE TO FAILURE'}) - for message in list_deprecations(spec, param): + for message in list_deprecations(spec, param): # pylint: disable=used-before-assignment self.deprecate(message['msg'], version=message.get('version'), date=message.get('date'), collection_name=message.get('collection_name')) diff --git a/tests/ee/roles/smoke/library/smoke_ipaddress.py b/tests/ee/roles/smoke/library/smoke_ipaddress.py index 62c5681c..4658003a 100644 --- a/tests/ee/roles/smoke/library/smoke_ipaddress.py +++ b/tests/ee/roles/smoke/library/smoke_ipaddress.py @@ -31,6 +31,7 @@ from ansible.module_utils.basic import AnsibleModule, missing_required_lib try: import ipaddress HAS_IPADDRESS = True + IPADDRESS_IMP_ERR = None except ImportError as exc: IPADDRESS_IMP_ERR = traceback.format_exc() HAS_IPADDRESS = False diff --git a/tests/ee/roles/smoke/library/smoke_pyyaml.py b/tests/ee/roles/smoke/library/smoke_pyyaml.py index b281da20..97a3ab0c 100644 --- a/tests/ee/roles/smoke/library/smoke_pyyaml.py +++ b/tests/ee/roles/smoke/library/smoke_pyyaml.py @@ -31,6 +31,7 @@ from ansible.module_utils.basic import AnsibleModule, missing_required_lib try: import yaml HAS_PYYAML = True + PYYAML_IMP_ERR = None except ImportError as exc: PYYAML_IMP_ERR = traceback.format_exc() HAS_PYYAML = False