mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
command: PEP8 compliancy (#27740)
This commit is contained in:
parent
d125520071
commit
bcb3e33adb
2 changed files with 24 additions and 25 deletions
|
@ -90,15 +90,15 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
|
||||
|
||||
def check_command(module, commandline):
|
||||
arguments = { 'chown': 'owner', 'chmod': 'mode', 'chgrp': 'group',
|
||||
'ln': 'state=link', 'mkdir': 'state=directory',
|
||||
'rmdir': 'state=absent', 'rm': 'state=absent', 'touch': 'state=touch' }
|
||||
commands = { 'hg': 'hg', 'curl': 'get_url or uri', 'wget': 'get_url or uri',
|
||||
'svn': 'subversion', 'service': 'service',
|
||||
'mount': 'mount', 'rpm': 'yum, dnf or zypper', 'yum': 'yum', 'apt-get': 'apt',
|
||||
'tar': 'unarchive', 'unzip': 'unarchive', 'sed': 'template or lineinfile',
|
||||
'dnf': 'dnf', 'zypper': 'zypper' }
|
||||
become = [ 'sudo', 'su', 'pbrun', 'pfexec', 'runas', 'pmrun' ]
|
||||
arguments = {'chown': 'owner', 'chmod': 'mode', 'chgrp': 'group',
|
||||
'ln': 'state=link', 'mkdir': 'state=directory',
|
||||
'rmdir': 'state=absent', 'rm': 'state=absent', 'touch': 'state=touch'}
|
||||
commands = {'hg': 'hg', 'curl': 'get_url or uri', 'wget': 'get_url or uri',
|
||||
'svn': 'subversion', 'service': 'service',
|
||||
'mount': 'mount', 'rpm': 'yum, dnf or zypper', 'yum': 'yum', 'apt-get': 'apt',
|
||||
'tar': 'unarchive', 'unzip': 'unarchive', 'sed': 'template or lineinfile',
|
||||
'dnf': 'dnf', 'zypper': 'zypper'}
|
||||
become = ['sudo', 'su', 'pbrun', 'pfexec', 'runas', 'pmrun']
|
||||
command = os.path.basename(commandline.split()[0])
|
||||
if command in arguments:
|
||||
module.warn("Consider using file module with %s rather than running %s" % (arguments[command], command))
|
||||
|
@ -114,13 +114,13 @@ def main():
|
|||
# hence don't copy this one if you are looking to build others!
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
_raw_params = dict(),
|
||||
_uses_shell = dict(type='bool', default=False),
|
||||
chdir = dict(type='path'),
|
||||
executable = dict(),
|
||||
creates = dict(type='path'),
|
||||
removes = dict(type='path'),
|
||||
warn = dict(type='bool', default=True),
|
||||
_raw_params=dict(),
|
||||
_uses_shell=dict(type='bool', default=False),
|
||||
chdir=dict(type='path'),
|
||||
executable=dict(),
|
||||
creates=dict(type='path'),
|
||||
removes=dict(type='path'),
|
||||
warn=dict(type='bool', default=True),
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -185,14 +185,14 @@ def main():
|
|||
err = b''
|
||||
|
||||
result = dict(
|
||||
cmd = args,
|
||||
stdout = out.rstrip(b"\r\n"),
|
||||
stderr = err.rstrip(b"\r\n"),
|
||||
rc = rc,
|
||||
start = str(startd),
|
||||
end = str(endd),
|
||||
delta = str(delta),
|
||||
changed = True,
|
||||
cmd=args,
|
||||
stdout=out.rstrip(b"\r\n"),
|
||||
stderr=err.rstrip(b"\r\n"),
|
||||
rc=rc,
|
||||
start=str(startd),
|
||||
end=str(endd),
|
||||
delta=str(delta),
|
||||
changed=True,
|
||||
)
|
||||
|
||||
if rc != 0:
|
||||
|
|
|
@ -195,7 +195,6 @@ lib/ansible/modules/clustering/consul_kv.py
|
|||
lib/ansible/modules/clustering/consul_session.py
|
||||
lib/ansible/modules/clustering/kubernetes.py
|
||||
lib/ansible/modules/clustering/pacemaker_cluster.py
|
||||
lib/ansible/modules/commands/command.py
|
||||
lib/ansible/modules/database/misc/elasticsearch_plugin.py
|
||||
lib/ansible/modules/database/misc/kibana_plugin.py
|
||||
lib/ansible/modules/database/misc/redis.py
|
||||
|
|
Loading…
Reference in a new issue