Fix errors reported by pylint. (#23282)

* Fix pylint misplaced-bare-raise errors.
* Fix pylint return-in-init error.
* Fix pylint bad-format-character error.
* Fix pylint too-many-format-args errors.
* Fix pylint too-few-format-args errors.
* Fix pylint truncated-format-string error.
This commit is contained in:
Matt Clay 2017-04-06 16:58:16 -07:00 committed by GitHub
parent 9e1bf1c6f2
commit 48eeab8a53
15 changed files with 17 additions and 25 deletions

View file

@ -135,11 +135,11 @@ def content_to_dict(module, content):
content_dict = yaml.safe_load(content)
if not isinstance(content_dict, dict):
raise
raise Exception()
# Check if dict is empty and return an error if it's
if not content_dict:
raise
raise Exception()
except:
module.fail_json(msg="Unable to convert 'content' to a dict, please check if valid")

View file

@ -1882,7 +1882,7 @@ class AnsibleModule(object):
try:
cwd = os.getcwd()
if not os.access(cwd, os.F_OK|os.R_OK):
raise
raise Exception()
return cwd
except:
# we don't have access to the cwd, probably because of sudo.

View file

@ -330,7 +330,7 @@ class AnsibleDockerClient(Client):
msg = "You asked for verification that Docker host name matches %s. The actual hostname is %s. " \
"Most likely you need to set DOCKER_TLS_HOSTNAME or pass tls_hostname with a value of %s. " \
"You may also use TLS without verification by setting the tls parameter to true." \
% (self.auth_params['tls_hostname'], match.group(1))
% (self.auth_params['tls_hostname'], match.group(1), match.group(1))
self.fail(msg)
self.fail("SSL Exception: %s" % (error))