diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-09-03 15:47:53 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-09-03 15:47:53 +0100 |
commit | a6576643b50ad69ec536b0fefadb05301a755a93 (patch) | |
tree | d09cd92bf692fad8d5d85a13e15442b537d53f56 | |
parent | 7cf679f38371c0bf1e44acb542226ebc68b4c432 (diff) | |
download | sos-a6576643b50ad69ec536b0fefadb05301a755a93.tar.gz |
[postgresql] ensure password option is initialised to known value
The value of self.get_option("password") is tested in the
postgresql plugin's setup() method to determine if the user gave
a password on the command line. Set the default value to False to
ensure we get the expected comparison results.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/postgresql.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py index 87a07d0f..ea593f91 100644 --- a/sos/plugins/postgresql.py +++ b/sos/plugins/postgresql.py @@ -38,7 +38,7 @@ class PostgreSQL(Plugin): option_list = [ ('pghome', 'PostgreSQL server home directory.', '', '/var/lib/pgsql'), ('username', 'username for pg_dump', '', 'postgres'), - ('password', 'password for pg_dump' + password_warn_text, '', ''), + ('password', 'password for pg_dump' + password_warn_text, '', False), ('dbname', 'database name to dump for pg_dump', '', ''), ('dbhost', 'database hostname/IP (do not use unix socket)', '', ''), ('dbport', 'database server port number', '', '5432') @@ -49,7 +49,7 @@ class PostgreSQL(Plugin): # We're only modifying this for ourself and our children so there # 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 None: + if self.get_option("password") is not False: os.environ["PGPASSWORD"] = self.get_option("password") if self.get_option("dbhost"): |