symlinks for keystone and nova

This commit is contained in:
Gunther Hagleitner 2012-02-03 00:11:41 -08:00
parent 06d80c1244
commit b8a270519c
4 changed files with 29 additions and 1 deletions

@ -148,6 +148,9 @@ class PkgInstallComponent(ComponentBase):
def _get_source_config(self, config_fn):
return utils.load_template(self.component_name, config_fn)
def _get_symlinks(self):
return {}
def _configure_files(self):
configs = self._get_config_files()
if configs:
@ -174,7 +177,14 @@ class PkgInstallComponent(ComponentBase):
def configure(self):
self.tracewriter.make_dir(self.cfgdir)
return self._configure_files()
l = self._configure_files()
links = self._get_symlinks()
for (source, link) in links.items():
try:
sh.symlink(source, link)
except OSError:
LOG.info("symlink %s => %s already exists." % (source, link))
return l
class PythonInstallComponent(PkgInstallComponent):

@ -90,6 +90,10 @@ class KeystoneInstaller(comp.PythonInstallComponent):
def _get_pkgs(self):
return list(REQ_PKGS)
def _get_symlinks(self):
return {sh.joinpths(self.cfgdir, ROOT_CONF): '/etc/keystone/keystone.conf'}
def post_install(self):
parent_result = comp.PythonInstallComponent.post_install(self)
self._setup_db()

@ -198,6 +198,9 @@ class NovaInstaller(comp.PythonInstallComponent):
pkgs.extend(fns)
return pkgs
def _get_symlinks(self):
return {sh.joinpths(self.cfgdir, API_CONF): '/etc/nova/nova.conf'}
def _get_pips(self):
return list(REQ_PIPS)

@ -301,10 +301,21 @@ def rmdir(path, quiet=True):
pass
def symlink(source, link):
path = dirname(link)
file_ = basename(link)
mkdirslist(path)
os.symlink(source, link)
def exists(path):
return os.path.exists(path)
def basename(path):
return os.path.basename(path)
def dirname(path):
return os.path.dirname(path)