1
0
Fork 0
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:
Alexei Znamensky 2021-11-30 18:02:38 +13:00 committed by GitHub
parent aae3ae1a8e
commit cb0ade4323
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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).

View file

@ -63,7 +63,7 @@ def query_log_status(module, le_path, path, state="present"):
""" Returns whether a log is followed or not. """
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:
return True
@ -87,7 +87,7 @@ def follow_log(module, le_path, logs, name=None, logtype=None):
cmd.extend(['--name', name])
if 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):
module.fail_json(msg="failed to follow '%s': %s" % (log, err.strip()))