Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
9f083bfc
Commit
9f083bfc
authored
Feb 26, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2207 from marktheunissen/mysql-pass-and-password
Adding back support for pass=
parents
93f02d61
234d31bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
library/mysql_db
+14
-2
library/mysql_user
+14
-2
No files found.
library/mysql_db
View file @
9f083bfc
...
@@ -131,8 +131,20 @@ def load_mycnf():
...
@@ -131,8 +131,20 @@ def load_mycnf():
return
False
return
False
try
:
try
:
config
.
readfp
(
open
(
mycnf
))
config
.
readfp
(
open
(
mycnf
))
creds
=
dict
(
user
=
config
.
get
(
'client'
,
'user'
),
passwd
=
config
.
get
(
'client'
,
'password'
))
except
(
IOError
):
except
(
ConfigParser
.
NoOptionError
,
IOError
):
return
False
# We support two forms of passwords in .my.cnf, both pass= and password=,
# as these are both supported by MySQL.
try
:
passwd
=
config
.
get
(
'client'
,
'password'
)
except
(
ConfigParser
.
NoOptionError
):
try
:
passwd
=
config
.
get
(
'client'
,
'pass'
)
except
(
ConfigParser
.
NoOptionError
):
return
False
try
:
creds
=
dict
(
user
=
config
.
get
(
'client'
,
'user'
),
passwd
=
passwd
)
except
(
ConfigParser
.
NoOptionError
):
return
False
return
False
return
creds
return
creds
...
...
library/mysql_user
View file @
9f083bfc
...
@@ -236,8 +236,20 @@ def load_mycnf():
...
@@ -236,8 +236,20 @@ def load_mycnf():
return
False
return
False
try
:
try
:
config
.
readfp
(
open
(
mycnf
))
config
.
readfp
(
open
(
mycnf
))
creds
=
dict
(
user
=
config
.
get
(
'client'
,
'user'
),
password
=
config
.
get
(
'client'
,
'password'
))
except
(
IOError
):
except
(
ConfigParser
.
NoOptionError
,
IOError
):
return
False
# We support two forms of passwords in .my.cnf, both pass= and password=,
# as these are both supported by MySQL.
try
:
passwd
=
config
.
get
(
'client'
,
'password'
)
except
(
ConfigParser
.
NoOptionError
):
try
:
passwd
=
config
.
get
(
'client'
,
'pass'
)
except
(
ConfigParser
.
NoOptionError
):
return
False
try
:
creds
=
dict
(
user
=
config
.
get
(
'client'
,
'user'
),
passwd
=
passwd
)
except
(
ConfigParser
.
NoOptionError
):
return
False
return
False
return
creds
return
creds
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment