Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos-caddy
Commits
29e65e56
Commit
29e65e56
authored
Jan 25, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make "socket" parameter optional.
parent
02aaefe2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
slapos/recipe/generic_mysql/mysql.py
slapos/recipe/generic_mysql/mysql.py
+6
-2
No files found.
slapos/recipe/generic_mysql/mysql.py
View file @
29e65e56
...
...
@@ -42,7 +42,9 @@ def updateMysql(args):
sleep
=
30
is_succeed
=
False
while
True
:
mysql_upgrade_list
=
[
conf
[
'mysql_upgrade_binary'
],
'--no-defaults'
,
'--user=root'
,
'--socket=%s'
%
conf
[
'socket'
]]
mysql_upgrade_list
=
[
conf
[
'mysql_upgrade_binary'
],
'--no-defaults'
,
'--user=root'
]
if
'socket'
in
conf
:
mysql_upgrade_list
.
append
(
'--socket='
+
conf
[
'socket'
])
mysql_upgrade
=
subprocess
.
Popen
(
mysql_upgrade_list
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
result
=
mysql_upgrade
.
communicate
()[
0
]
if
mysql_upgrade
.
returncode
is
None
:
...
...
@@ -54,7 +56,9 @@ def updateMysql(args):
print
"MySQL database upgraded with result:
\
n
%s"
%
result
else
:
print
"No need to upgrade MySQL database"
mysql_list
=
[
conf
[
'mysql_binary'
].
strip
(),
'--no-defaults'
,
'-B'
,
'--user=root'
,
'--socket=%s'
%
conf
[
'socket'
]]
mysql_list
=
[
conf
[
'mysql_binary'
].
strip
(),
'--no-defaults'
,
'-B'
,
'--user=root'
]
if
'socket'
in
conf
:
mysql_list
.
append
(
'--socket='
+
conf
[
'socket'
])
mysql
=
subprocess
.
Popen
(
mysql_list
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
result
=
mysql
.
communicate
(
conf
[
'mysql_script'
])[
0
]
...
...
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