aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-12-23 14:40:50 +0000
committerBryn M. Reeves <bmr@redhat.com>2014-12-23 14:40:50 +0000
commitdb9ac3fb615b731be87b4116a8939105bf5ced56 (patch)
tree5d8d3595f0c2a54c05310e05b90df1c7da753412
parent0be76caf77b53ce2726cb419262ceb8f52081c9e (diff)
downloadsos-db9ac3fb615b731be87b4116a8939105bf5ced56.tar.gz
[mysql] fix command-line dbpass handling
The logic for chosing between a command-line and environment variable passed password in the MySQL plugin was incorrect. This prevents a database dump from being collected when a password is given on the command line. Altough use of the command line to pass authentication tokens is discouraged we should ensure the case works. Fixes #456. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/mysql.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sos/plugins/mysql.py b/sos/plugins/mysql.py
index d148472a..edab6d01 100644
--- a/sos/plugins/mysql.py
+++ b/sos/plugins/mysql.py
@@ -45,9 +45,9 @@ class Mysql(Plugin):
if self.get_option("dbdump"):
dbuser = self.get_option("dbuser")
dbpass = self.get_option("dbpass")
- if dbpass is False and 'MYSQL_PWD' in os.environ:
+ if 'MYSQL_PWD' in os.environ:
dbpass = os.environ['MYSQL_PWD']
- else:
+ if not dbpass or dbpass is False:
# no MySQL password
return
os.environ['MYSQL_PWD'] = dbpass