Start splitting the DBInstaller class into distro-specific versions. Only Oneiric is implemented for now.
This commit is contained in:
parent
81cbd39b67
commit
993173e2cb
@ -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)
|
||||
|
0
devstack/distros/__init__.py
Normal file
0
devstack/distros/__init__.py
Normal file
25
devstack/distros/oneiric.py
Normal file
25
devstack/distros/oneiric.py
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user