Miscellaneous pylint fixes.

The following rules are no longer disabled:

- bad-format-string
- duplicate-key
- lost-exception
- trailing-newlines
- unexpected-keyword-arg
- useless-suppression
- using-constant-test
This commit is contained in:
Matt Clay 2017-09-12 18:49:24 -07:00
parent 77b2aca5a2
commit 442af3744e
35 changed files with 17 additions and 43 deletions

View file

@ -532,7 +532,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
elif 'json' in errormsg or 'simplejson' in errormsg:
x = "5" # json or simplejson modules needed
finally:
return x
return x # pylint: disable=lost-exception
def _remote_expand_user(self, path, sudoable=True):
''' takes a remote path and performs tilde expansion on the remote host '''

View file

@ -60,7 +60,7 @@ class Cliconf(CliconfBase):
cmd = b'show configuration'
else:
cmd = b'show configuration | display %s' % format
return self.send_command(to_bytes(cmd), errors='surrogate_or_strict')
return self.send_command(to_bytes(cmd, errors='surrogate_or_strict'))
def edit_config(self, command):
for cmd in chain([b'configure'], to_list(command)):

View file

@ -589,6 +589,7 @@ class Connection(ConnectionBase):
# Make sure stdin is a proper pty to avoid tcgetattr errors
master, slave = pty.openpty()
if PY3 and self._play_context.password:
# pylint: disable=unexpected-keyword-arg
p = subprocess.Popen(cmd, stdin=slave, stdout=subprocess.PIPE, stderr=subprocess.PIPE, pass_fds=self.sshpass_pipe)
else:
p = subprocess.Popen(cmd, stdin=slave, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@ -599,6 +600,7 @@ class Connection(ConnectionBase):
if not p:
if PY3 and self._play_context.password:
# pylint: disable=unexpected-keyword-arg
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, pass_fds=self.sshpass_pipe)
else:
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

View file

@ -139,7 +139,6 @@ class Etcd:
value = "ENOENT"
except:
raise
pass
return value