[sos-devel] [PATCH] postgresql: avoid to crash with numerical passwords

Sandro Bonazzola sbonazzo at redhat.com
Fri Nov 14 13:35:45 UTC 2014


Issue: https://github.com/sosreport/sos/issues/433
Change-Id: I99fd0fe913e3f99826f98cb2b8cf7a460ecb5c4c
Signed-off-by: Sandro Bonazzola <sbonazzo at redhat.com>
---
 sos/plugins/postgresql.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py
index 350131f..0a51074 100644
--- a/sos/plugins/postgresql.py
+++ b/sos/plugins/postgresql.py
@@ -51,7 +51,7 @@ class PostgreSQL(Plugin):
         # is no need to save and restore environment variables if the user
         # decided to pass the password on the command line.
         if self.get_option("password") is not False:
-            os.environ["PGPASSWORD"] = self.get_option("password")
+            os.environ["PGPASSWORD"] = str(self.get_option("password"))
 
         if self.get_option("dbhost"):
             cmd = "pg_dump -U %s -h %s -p %s -w -f %s -F t %s" % (
-- 
1.9.3




More information about the sos-devel mailing list