Skip to content

Commit

Permalink
[foreman] call psql with --no-password to avoid waiting on input
Browse files Browse the repository at this point in the history
Resolved: sosreport#2429
Related: sosreport#2422
Closes: sosreport#2421

Signed-off-by: Jan Jansky <jjansky@redhat.com>
  • Loading branch information
jjansky1 committed Mar 16, 2021
1 parent 9ad923d commit 47006eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sos/plugins/foreman.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ def build_query_cmd(self, query, csv=False):
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):
Expand Down

0 comments on commit 47006eb

Please sign in to comment.