mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
logentries - invoke run_command passing list (#3807)
* logentries - invoke run_command passing list * added changelog fragment
This commit is contained in:
parent
aae3ae1a8e
commit
cb0ade4323
2 changed files with 4 additions and 2 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- logentries - calling ``run_command`` with arguments as ``list`` instead of ``str`` (https://github.com/ansible-collections/community.general/pull/3807).
|
|
@ -63,7 +63,7 @@ def query_log_status(module, le_path, path, state="present"):
|
||||||
""" Returns whether a log is followed or not. """
|
""" Returns whether a log is followed or not. """
|
||||||
|
|
||||||
if state == "present":
|
if state == "present":
|
||||||
rc, out, err = module.run_command("%s followed %s" % (le_path, path))
|
rc, out, err = module.run_command([le_path, "followed", path])
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ def follow_log(module, le_path, logs, name=None, logtype=None):
|
||||||
cmd.extend(['--name', name])
|
cmd.extend(['--name', name])
|
||||||
if logtype:
|
if logtype:
|
||||||
cmd.extend(['--type', logtype])
|
cmd.extend(['--type', logtype])
|
||||||
rc, out, err = module.run_command(' '.join(cmd))
|
rc, out, err = module.run_command(cmd)
|
||||||
|
|
||||||
if not query_log_status(module, le_path, log):
|
if not query_log_status(module, le_path, log):
|
||||||
module.fail_json(msg="failed to follow '%s': %s" % (log, err.strip()))
|
module.fail_json(msg="failed to follow '%s': %s" % (log, err.strip()))
|
||||||
|
|
Loading…
Reference in a new issue