Fix some new linting errors (#499)
* Fix some new linting errors. * More linting errors. ci_completepull/500/head
parent
c0bab015a4
commit
fd1263c9aa
|
@ -48,6 +48,7 @@ except ImportError:
|
||||||
IPADDRESS_IMPORT_ERROR = traceback.format_exc()
|
IPADDRESS_IMPORT_ERROR = traceback.format_exc()
|
||||||
else:
|
else:
|
||||||
HAS_IPADDRESS = True
|
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):
|
def _assert_fetch_url_success(module, response, info, allow_redirect=False, allow_client_error=True, allow_server_error=True):
|
||||||
|
|
|
@ -217,7 +217,7 @@ class AnsibleActionModule(object):
|
||||||
|
|
||||||
# this uses exceptions as it happens before we can safely call fail_json
|
# this uses exceptions as it happens before we can safely call fail_json
|
||||||
alias_warnings = []
|
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:
|
for option, alias in alias_warnings:
|
||||||
self.warn('Both option %s and its alias %s are set.' % (option_prefix + option, option_prefix + alias))
|
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
|
param = self.params
|
||||||
|
|
||||||
try:
|
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:
|
except TypeError as te:
|
||||||
self.fail_json(msg="Failure when processing no_log parameters. Module invocation will be hidden. "
|
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'})
|
"%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'),
|
self.deprecate(message['msg'], version=message.get('version'), date=message.get('date'),
|
||||||
collection_name=message.get('collection_name'))
|
collection_name=message.get('collection_name'))
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||||
try:
|
try:
|
||||||
import ipaddress
|
import ipaddress
|
||||||
HAS_IPADDRESS = True
|
HAS_IPADDRESS = True
|
||||||
|
IPADDRESS_IMP_ERR = None
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
IPADDRESS_IMP_ERR = traceback.format_exc()
|
IPADDRESS_IMP_ERR = traceback.format_exc()
|
||||||
HAS_IPADDRESS = False
|
HAS_IPADDRESS = False
|
||||||
|
|
|
@ -31,6 +31,7 @@ from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||||
try:
|
try:
|
||||||
import yaml
|
import yaml
|
||||||
HAS_PYYAML = True
|
HAS_PYYAML = True
|
||||||
|
PYYAML_IMP_ERR = None
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
PYYAML_IMP_ERR = traceback.format_exc()
|
PYYAML_IMP_ERR = traceback.format_exc()
|
||||||
HAS_PYYAML = False
|
HAS_PYYAML = False
|
||||||
|
|
Loading…
Reference in New Issue