diff --git a/devstack/components/db.py b/devstack/components/db.py index 01ea1bc7..521f7f1d 100644 --- a/devstack/components/db.py +++ b/devstack/components/db.py @@ -120,18 +120,11 @@ class DBInstaller(comp.PkgInstallComponent): fc = utils.joinlinesep(*new_lines) with sh.Rooted(True): sh.write_file('/etc/my.cnf', fc) - elif self.distro == settings.UBUNTU11 and dbtype == MYSQL: - LOG.info("Fixing up %s mysql configs." % (settings.UBUNTU11)) - fc = sh.load_file('/etc/mysql/my.cnf') - lines = fc.splitlines() - new_lines = list() - for line in lines: - if line.startswith('bind-address'): - line = 'bind-address = %s' % ('0.0.0.0') - new_lines.append(line) - fc = utils.joinlinesep(*new_lines) - with sh.Rooted(True): - sh.write_file('/etc/mysql/my.cnf', fc) + else: + raise NotImplementedError( + 'Do not know how to configure db confs for %s' % + self.distro.name + ) def _get_pkgs(self): return list(REQ_PKGS) diff --git a/devstack/distros/__init__.py b/devstack/distros/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/devstack/distros/oneiric.py b/devstack/distros/oneiric.py new file mode 100644 index 00000000..eb98ffef --- /dev/null +++ b/devstack/distros/oneiric.py @@ -0,0 +1,25 @@ +"""Platform-specific logic for Ubunutu Oneiric components. +""" + +from devstack.components import db +from devstack import log as logging +from devstack import shell as sh +from devstack import utils + +LOG = logging.getLogger(__name__) + + +class OneiricDBInstaller(db.DBInstaller): + + def _configure_db_confs(self): + LOG.info("Fixing up %s mysql configs.", self.distro.name) + fc = sh.load_file('/etc/mysql/my.cnf') + lines = fc.splitlines() + new_lines = list() + for line in lines: + if line.startswith('bind-address'): + line = 'bind-address = %s' % ('0.0.0.0') + new_lines.append(line) + fc = utils.joinlinesep(*new_lines) + with sh.Rooted(True): + sh.write_file('/etc/mysql/my.cnf', fc)