mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
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:
@@ -109,6 +109,7 @@ class ConfigCLI(CLI):
|
||||
'''
|
||||
raise AnsibleError("Option not implemented yet")
|
||||
|
||||
# pylint: disable=unreachable
|
||||
if self.options.setting is None:
|
||||
raise AnsibleOptionsError("update option requries a setting to update")
|
||||
|
||||
@@ -141,6 +142,8 @@ class ConfigCLI(CLI):
|
||||
Opens ansible.cfg in the default EDITOR
|
||||
'''
|
||||
raise AnsibleError("Option not implemented yet")
|
||||
|
||||
# pylint: disable=unreachable
|
||||
try:
|
||||
editor = shlex.split(os.environ.get('EDITOR','vi'))
|
||||
editor.append(self.config_file)
|
||||
|
||||
@@ -643,7 +643,6 @@ class GalaxyCLI(CLI):
|
||||
|
||||
if len(self.args) < 4:
|
||||
raise AnsibleError("Missing one or more arguments. Expecting: source github_user github_repo secret")
|
||||
return 0
|
||||
|
||||
secret = self.args.pop()
|
||||
github_repo = self.args.pop()
|
||||
|
||||
@@ -42,4 +42,3 @@ class ConfigData(object):
|
||||
if plugin.name not in self._plugins[plugin.type]:
|
||||
self._plugins[plugin.type][plugin.name] = {}
|
||||
self._plugins[plugin.type][plugin.name][setting.name] = setting
|
||||
|
||||
|
||||
@@ -147,11 +147,6 @@ class Rhsm(RegistrationBase):
|
||||
* Boolean - whether the current system is currently registered to
|
||||
RHN.
|
||||
'''
|
||||
# Quick version...
|
||||
if False:
|
||||
return os.path.isfile('/etc/pki/consumer/cert.pem') and \
|
||||
os.path.isfile('/etc/pki/consumer/key.pem')
|
||||
|
||||
args = ['subscription-manager', 'identity']
|
||||
rc, stdout, stderr = self.module.run_command(args, check_rc=False)
|
||||
if rc == 0:
|
||||
|
||||
@@ -293,4 +293,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ def main():
|
||||
module.fail_json(msg="server {server} already has a "
|
||||
"floating-ip on requested "
|
||||
"interface but it doesn't match "
|
||||
"requested network {network: {fip}"
|
||||
"requested network {network}: {fip}"
|
||||
.format(server=server_name_or_id,
|
||||
network=network,
|
||||
fip=remove_values(f_ip,
|
||||
|
||||
@@ -167,4 +167,3 @@ from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.openstack import *
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -199,4 +199,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -181,4 +181,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -381,4 +381,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -365,4 +365,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -318,4 +318,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -225,4 +225,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -294,4 +294,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -325,4 +325,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -248,4 +248,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -152,4 +152,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -432,4 +432,3 @@ def main():
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
@@ -289,4 +289,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -351,4 +351,3 @@ def main():
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
@@ -295,4 +295,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -308,4 +308,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -270,4 +270,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -329,4 +329,3 @@ def main():
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -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 '''
|
||||
|
||||
@@ -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)):
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -139,7 +139,6 @@ class Etcd:
|
||||
value = "ENOENT"
|
||||
except:
|
||||
raise
|
||||
pass
|
||||
|
||||
return value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user