Get the pips for a component from the settings in the distro file instead of the JSON files.
This commit is contained in:
parent
ffb35db8bf
commit
8ae61183b5
@ -62,6 +62,7 @@ class ComponentBase(object):
|
||||
# The runner has a reference to us, so use a weakref here to
|
||||
# avoid breaking garbage collection.
|
||||
self.runner = weakref.proxy(runner)
|
||||
|
||||
self.root = root_dir
|
||||
self.component_opts = component_options or {}
|
||||
self.instances = instances or {}
|
||||
@ -253,21 +254,10 @@ class PythonInstallComponent(PkgInstallComponent):
|
||||
py_dirs[self.component_name] = self.appdir
|
||||
return py_dirs
|
||||
|
||||
def _get_pips(self):
|
||||
return list()
|
||||
|
||||
def _get_pips_expanded(self):
|
||||
shorts = self._get_pips()
|
||||
if not shorts:
|
||||
return dict()
|
||||
pips = dict()
|
||||
for fn in shorts:
|
||||
full_name = sh.joinpths(settings.STACK_PIP_DIR, fn)
|
||||
pips = utils.extract_pip_list([full_name], self.distro.name, pips)
|
||||
return pips
|
||||
|
||||
def _install_pips(self):
|
||||
pips = self._get_pips_expanded()
|
||||
pips = dict((p['name'], p)
|
||||
for p in self.component_opts.get('pips', [])
|
||||
)
|
||||
if pips:
|
||||
LOG.info("Setting up %s pips (%s)",
|
||||
len(pips), ", ".join(pips.keys()))
|
||||
|
@ -78,9 +78,6 @@ SUB_TO_APP = {
|
||||
CONFIG_DIR = 'etc'
|
||||
BIN_DIR = 'bin'
|
||||
|
||||
#pip files that glance requires
|
||||
REQ_PIPS = ['general.json', 'glance.json']
|
||||
|
||||
|
||||
class GlanceUninstaller(comp.PythonUninstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
@ -104,9 +101,6 @@ class GlanceInstaller(comp.PythonInstallComponent):
|
||||
def _get_config_files(self):
|
||||
return list(CONFIGS)
|
||||
|
||||
def _get_pips(self):
|
||||
return list(REQ_PIPS)
|
||||
|
||||
def post_install(self):
|
||||
comp.PythonInstallComponent.post_install(self)
|
||||
self._setup_db()
|
||||
|
@ -67,9 +67,6 @@ BAD_APACHE_USERS = ['root']
|
||||
#apache logs will go here
|
||||
LOGS_DIR = "logs"
|
||||
|
||||
#pip files that horizon requires
|
||||
REQ_PIPS = ['general.json', 'horizon.json']
|
||||
|
||||
|
||||
class HorizonUninstaller(comp.PythonUninstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
@ -118,9 +115,6 @@ class HorizonInstaller(comp.PythonInstallComponent):
|
||||
msg = "You may want to adjust your configuration, (user=%s, group=%s) will not work with apache!" % (user, group)
|
||||
raise excp.ConfigException(msg)
|
||||
|
||||
def _get_pips(self):
|
||||
return list(REQ_PIPS)
|
||||
|
||||
def _get_target_config_name(self, config_name):
|
||||
if config_name == HORIZON_PY_CONF:
|
||||
return sh.joinpths(self.dash_dir, *HORIZON_PY_CONF_TGT)
|
||||
|
@ -66,9 +66,6 @@ APP_OPTIONS = {
|
||||
}
|
||||
|
||||
|
||||
#pip files that keystone requires
|
||||
REQ_PIPS = ['general.json', 'keystone.json']
|
||||
|
||||
#used to wait until started before we can run the data setup script
|
||||
WAIT_ONLINE_TO = settings.WAIT_ALIVE_SECS
|
||||
|
||||
@ -107,9 +104,6 @@ class KeystoneInstaller(comp.PythonInstallComponent):
|
||||
})
|
||||
return places
|
||||
|
||||
def _get_pips(self):
|
||||
return list(REQ_PIPS)
|
||||
|
||||
def post_install(self):
|
||||
comp.PythonInstallComponent.post_install(self)
|
||||
self._setup_db()
|
||||
|
@ -22,9 +22,6 @@ from devstack import settings
|
||||
TYPE = settings.KEYSTONE_CLIENT
|
||||
LOG = logging.getLogger("devstack.components.keystone_client")
|
||||
|
||||
#the pkg json files keystone client requires for installation
|
||||
REQ_PIPS = ['general.json']
|
||||
|
||||
|
||||
class KeyStoneClientUninstaller(comp.PythonUninstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
@ -43,9 +40,6 @@ class KeyStoneClientInstaller(comp.PythonInstallComponent):
|
||||
})
|
||||
return places
|
||||
|
||||
def _get_pips(self):
|
||||
return list(REQ_PIPS)
|
||||
|
||||
|
||||
class KeyStoneClientRuntime(comp.EmptyRuntime):
|
||||
def __init__(self, *args, **kargs):
|
||||
|
@ -213,9 +213,6 @@ VNC_DEF_ADDR = '127.0.0.1'
|
||||
#std compute extensions
|
||||
STD_COMPUTE_EXTS = 'nova.api.openstack.compute.contrib.standard_extensions'
|
||||
|
||||
#pip files that nova requires
|
||||
REQ_PIPS = ['general.json', 'nova.json']
|
||||
|
||||
#config keys we warm up so u won't be prompted later
|
||||
WARMUP_PWS = ['rabbit']
|
||||
|
||||
@ -298,9 +295,6 @@ class NovaInstaller(comp.PythonInstallComponent):
|
||||
links[source_fn] = sh.joinpths(self._get_link_dir(), API_CONF)
|
||||
return links
|
||||
|
||||
def _get_pips(self):
|
||||
return list(REQ_PIPS)
|
||||
|
||||
def _get_download_locations(self):
|
||||
places = list()
|
||||
places.append({
|
||||
|
@ -22,9 +22,6 @@ from devstack import settings
|
||||
TYPE = settings.NOVA_CLIENT
|
||||
LOG = logging.getLogger("devstack.components.nova_client")
|
||||
|
||||
#the pkg json files nova client requires for installation
|
||||
REQ_PIPS = ['general.json']
|
||||
|
||||
|
||||
class NovaClientUninstaller(comp.PythonUninstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
@ -43,9 +40,6 @@ class NovaClientInstaller(comp.PythonInstallComponent):
|
||||
})
|
||||
return places
|
||||
|
||||
def _get_pips(self):
|
||||
return list(REQ_PIPS)
|
||||
|
||||
|
||||
class NovaClientRuntime(comp.EmptyRuntime):
|
||||
def __init__(self, *args, **kargs):
|
||||
|
@ -36,9 +36,6 @@ APP_OPTIONS = {
|
||||
VNC_PROXY_APP: ['--flagfile', '%NOVA_CONF%', '--web', '.'],
|
||||
}
|
||||
|
||||
#pip files that no-vnc requires
|
||||
REQ_PIPS = ['general.json', 'n-vnc.json']
|
||||
|
||||
|
||||
class NoVNCUninstaller(comp.PythonUninstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
@ -60,9 +57,6 @@ class NoVNCInstaller(comp.PythonInstallComponent):
|
||||
})
|
||||
return places
|
||||
|
||||
def _get_pips(self):
|
||||
return list(REQ_PIPS)
|
||||
|
||||
|
||||
class NoVNCRuntime(comp.ProgramRuntime):
|
||||
def __init__(self, *args, **kargs):
|
||||
|
@ -69,9 +69,6 @@ APP_OPTIONS = {
|
||||
APP_Q_AGENT: ["%OVS_CONFIG_FILE%", "-v"],
|
||||
}
|
||||
|
||||
#pip files that nova requires
|
||||
REQ_PIPS = ['quantum.json']
|
||||
|
||||
|
||||
class QuantumUninstaller(comp.PkgUninstallComponent):
|
||||
def __init__(self, *args, **kargs):
|
||||
@ -103,9 +100,6 @@ class QuantumInstaller(comp.PkgInstallComponent):
|
||||
})
|
||||
return places
|
||||
|
||||
def _get_pips(self):
|
||||
return list(REQ_PIPS)
|
||||
|
||||
def get_dependencies(self):
|
||||
common_deps = comp.PkgInstallComponent.get_dependencies(self)
|
||||
add_deps = list()
|
||||
|
@ -272,28 +272,6 @@ def determine_distro():
|
||||
return (found_os, plt)
|
||||
|
||||
|
||||
def extract_pip_list(fns, distro, all_pips=None):
|
||||
if not all_pips:
|
||||
all_pips = dict()
|
||||
for fn in fns:
|
||||
js = load_json(fn)
|
||||
distro_pips = js.get(distro)
|
||||
if distro_pips:
|
||||
all_pips.update(distro_pips)
|
||||
return all_pips
|
||||
|
||||
|
||||
def extract_pkg_list(fns, distro, all_pkgs=None):
|
||||
if not all_pkgs:
|
||||
all_pkgs = dict()
|
||||
for fn in fns:
|
||||
js = load_json(fn)
|
||||
distro_pkgs = js.get(distro)
|
||||
if distro_pkgs:
|
||||
all_pkgs.update(distro_pkgs)
|
||||
return all_pkgs
|
||||
|
||||
|
||||
def get_components_order(components):
|
||||
if not components:
|
||||
return dict()
|
||||
|
Loading…
Reference in New Issue
Block a user