Blame SOURCES/sos-bz1126001-mysql-fix-command-line-dbpass-handling.patch

fc05a2
From db9ac3fb615b731be87b4116a8939105bf5ced56 Mon Sep 17 00:00:00 2001
fc05a2
From: "Bryn M. Reeves" <bmr@redhat.com>
fc05a2
Date: Tue, 23 Dec 2014 14:40:50 +0000
fc05a2
Subject: [PATCH] [mysql] fix command-line dbpass handling
fc05a2
fc05a2
The logic for chosing between a command-line and environment
fc05a2
variable passed password in the MySQL plugin was incorrect. This
fc05a2
prevents a database dump from being collected when a password is
fc05a2
given on the command line.
fc05a2
fc05a2
Altough use of the command line to pass authentication tokens
fc05a2
is discouraged we should ensure the case works.
fc05a2
fc05a2
Fixes #456.
fc05a2
fc05a2
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
fc05a2
---
fc05a2
 sos/plugins/mysql.py | 4 ++--
fc05a2
 1 file changed, 2 insertions(+), 2 deletions(-)
fc05a2
fc05a2
diff --git a/sos/plugins/mysql.py b/sos/plugins/mysql.py
fc05a2
index d148472..edab6d0 100644
fc05a2
--- a/sos/plugins/mysql.py
fc05a2
+++ b/sos/plugins/mysql.py
e75bc7
@@ -45,9 +45,9 @@ class Mysql(Plugin):
fc05a2
         if self.get_option("dbdump"):
fc05a2
             dbuser = self.get_option("dbuser")
fc05a2
             dbpass = self.get_option("dbpass")
fc05a2
-            if dbpass is False and 'MYSQL_PWD' in os.environ:
fc05a2
+            if 'MYSQL_PWD' in os.environ:
fc05a2
                 dbpass = os.environ['MYSQL_PWD']
fc05a2
-            else:
fc05a2
+            if not dbpass or dbpass is False:
fc05a2
                 # no MySQL password
fc05a2
                 return
fc05a2
             os.environ['MYSQL_PWD'] = dbpass
fc05a2
-- 
fc05a2
1.9.3
fc05a2