From ea9be29ef1635e317477c4bce3187671f414f76e Mon Sep 17 00:00:00 2001
From: Jan Jansky <jjansky@redhat.com>
Date: Mon, 1 Mar 2021 13:24:44 +0100
Subject: [PATCH] [foreman] call psql with --no-password to avoid waiting on
input
Backport #2422 to legacy-3.9.
Resolves: #2429
Closes: #2421
Signed-off-by: Jan Jansky <jjansky@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
sos/plugins/foreman.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sos/plugins/foreman.py b/sos/plugins/foreman.py
index ff79b81..84fb4b0 100644
--- a/sos/plugins/foreman.py
+++ b/sos/plugins/foreman.py
@@ -261,7 +261,8 @@ class Foreman(Plugin):
a large amount of quoting in sos logs referencing the command being run
"""
csvformat = "-A -F , -X" if csv else ""
- _dbcmd = "psql -h %s -p 5432 -U foreman -d foreman %s -c %s"
+ _dbcmd = "psql --no-password -h %s -p 5432 -U foreman -d foreman %s \
+ -c %s"
return _dbcmd % (self.dbhost, csvformat, quote(query))
def postproc(self):
--
1.8.3.1