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