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) (#3811)

* logentries - invoke run_command passing list

* added changelog fragment

(cherry picked from commit cb0ade4323)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-11-30 06:52:49 +01:00 committed by GitHub
parent b85ff2a997
commit 9ddb75a3a2
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. """ """ 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()))