aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonan Amicel <ronan.amicel@gmail.com>2012-09-11 09:02:56 +0200
committerRonan Amicel <ronan.amicel@gmail.com>2012-09-11 09:04:40 +0200
commitf19fb3bf2eb90f77b193dc25f5b8bec0dfd253bc (patch)
treed11ca9ca39c6e2dd487528e1db0acc3cd97a8051
parentRefactor watch context manager (diff)
downloadfabtools-f19fb3bf2eb90f77b193dc25f5b8bec0dfd253bc.tar.xz
Fix require MySQL server on Ubuntu 12.04 LTS
-rw-r--r--fabtools/require/mysql.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/fabtools/require/mysql.py b/fabtools/require/mysql.py
index 7edeed0..3e0e978 100644
--- a/fabtools/require/mysql.py
+++ b/fabtools/require/mysql.py
@@ -9,11 +9,16 @@ from fabtools.require.deb import package
from fabtools.require.service import started
-def server(version='5.1', password=None):
+def server(version=None, password=None):
"""
Require a MySQL server
"""
- if not is_installed("mysql-server-%s" % version):
+ if version:
+ pkg_name = 'mysql-server-%s' % version
+ else:
+ pkg_name = 'mysql-server'
+
+ if not is_installed(pkg_name):
if password is None:
password = prompt_password()
@@ -23,7 +28,7 @@ def server(version='5.1', password=None):
'mysql-server/root_password_again': ('password', password),
})
- package('mysql-server-%s' % version)
+ package(pkg_name)
started('mysql')