mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07: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):
|
def check_command(module, commandline):
|
||||||
arguments = { 'chown': 'owner', 'chmod': 'mode', 'chgrp': 'group',
|
arguments = {'chown': 'owner', 'chmod': 'mode', 'chgrp': 'group',
|
||||||
'ln': 'state=link', 'mkdir': 'state=directory',
|
'ln': 'state=link', 'mkdir': 'state=directory',
|
||||||
'rmdir': 'state=absent', 'rm': 'state=absent', 'touch': 'state=touch' }
|
'rmdir': 'state=absent', 'rm': 'state=absent', 'touch': 'state=touch'}
|
||||||
commands = { 'hg': 'hg', 'curl': 'get_url or uri', 'wget': 'get_url or uri',
|
commands = {'hg': 'hg', 'curl': 'get_url or uri', 'wget': 'get_url or uri',
|
||||||
'svn': 'subversion', 'service': 'service',
|
'svn': 'subversion', 'service': 'service',
|
||||||
'mount': 'mount', 'rpm': 'yum, dnf or zypper', 'yum': 'yum', 'apt-get': 'apt',
|
'mount': 'mount', 'rpm': 'yum, dnf or zypper', 'yum': 'yum', 'apt-get': 'apt',
|
||||||
'tar': 'unarchive', 'unzip': 'unarchive', 'sed': 'template or lineinfile',
|
'tar': 'unarchive', 'unzip': 'unarchive', 'sed': 'template or lineinfile',
|
||||||
'dnf': 'dnf', 'zypper': 'zypper' }
|
'dnf': 'dnf', 'zypper': 'zypper'}
|
||||||
become = [ 'sudo', 'su', 'pbrun', 'pfexec', 'runas', 'pmrun' ]
|
become = ['sudo', 'su', 'pbrun', 'pfexec', 'runas', 'pmrun']
|
||||||
command = os.path.basename(commandline.split()[0])
|
command = os.path.basename(commandline.split()[0])
|
||||||
if command in arguments:
|
if command in arguments:
|
||||||
module.warn("Consider using file module with %s rather than running %s" % (arguments[command], command))
|
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!
|
# hence don't copy this one if you are looking to build others!
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=dict(
|
argument_spec=dict(
|
||||||
_raw_params = dict(),
|
_raw_params=dict(),
|
||||||
_uses_shell = dict(type='bool', default=False),
|
_uses_shell=dict(type='bool', default=False),
|
||||||
chdir = dict(type='path'),
|
chdir=dict(type='path'),
|
||||||
executable = dict(),
|
executable=dict(),
|
||||||
creates = dict(type='path'),
|
creates=dict(type='path'),
|
||||||
removes = dict(type='path'),
|
removes=dict(type='path'),
|
||||||
warn = dict(type='bool', default=True),
|
warn=dict(type='bool', default=True),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -185,14 +185,14 @@ def main():
|
||||||
err = b''
|
err = b''
|
||||||
|
|
||||||
result = dict(
|
result = dict(
|
||||||
cmd = args,
|
cmd=args,
|
||||||
stdout = out.rstrip(b"\r\n"),
|
stdout=out.rstrip(b"\r\n"),
|
||||||
stderr = err.rstrip(b"\r\n"),
|
stderr=err.rstrip(b"\r\n"),
|
||||||
rc = rc,
|
rc=rc,
|
||||||
start = str(startd),
|
start=str(startd),
|
||||||
end = str(endd),
|
end=str(endd),
|
||||||
delta = str(delta),
|
delta=str(delta),
|
||||||
changed = True,
|
changed=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
if rc != 0:
|
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/consul_session.py
|
||||||
lib/ansible/modules/clustering/kubernetes.py
|
lib/ansible/modules/clustering/kubernetes.py
|
||||||
lib/ansible/modules/clustering/pacemaker_cluster.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/elasticsearch_plugin.py
|
||||||
lib/ansible/modules/database/misc/kibana_plugin.py
|
lib/ansible/modules/database/misc/kibana_plugin.py
|
||||||
lib/ansible/modules/database/misc/redis.py
|
lib/ansible/modules/database/misc/redis.py
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue