diff --git a/changelogs/fragments/3807-logentries-run_command-list.yaml b/changelogs/fragments/3807-logentries-run_command-list.yaml new file mode 100644 index 0000000000..1a69df1dfe --- /dev/null +++ b/changelogs/fragments/3807-logentries-run_command-list.yaml @@ -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). diff --git a/plugins/modules/monitoring/logentries.py b/plugins/modules/monitoring/logentries.py index 8f39fb5106..075752862d 100644 --- a/plugins/modules/monitoring/logentries.py +++ b/plugins/modules/monitoring/logentries.py @@ -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()))