Merge pull request #141 from dreamhost/fix-quantum-subsystems

Fix quantum subsystems
This commit is contained in:
Joshua Harlow 2012-03-26 13:30:05 -07:00
commit 29c9ff69b0
4 changed files with 28 additions and 19 deletions

@ -585,6 +585,8 @@ components:
subsystems: subsystems:
openvswitch: openvswitch:
packages: packages:
- name: linux-headers-server
removable: true
- name: openvswitch-datapath-dkms - name: openvswitch-datapath-dkms
removable: true removable: true
version: 1.2* version: 1.2*

@ -38,6 +38,8 @@ subsystems:
- sched - sched
- vol - vol
- xvnc - xvnc
quantum:
- openvswitch
supports: supports:
- rhel-6 - rhel-6
- ubuntu-oneiric - ubuntu-oneiric

@ -109,7 +109,7 @@ class ComponentBase(object):
LOG.warning("Unknown option %r provided for (%s)" % (s, self)) LOG.warning("Unknown option %r provided for (%s)" % (s, self))
def __str__(self): def __str__(self):
return "%r: %s" % (self.__class__.__name__, self.component_name) return "%s: %s" % (self.__class__.__name__, self.component_name)
def known_subsystems(self): def known_subsystems(self):
return set() return set()

@ -60,22 +60,16 @@ APP_OPTIONS = {
APP_Q_AGENT: ["%OVS_CONFIG_FILE%", "-v"], APP_Q_AGENT: ["%OVS_CONFIG_FILE%", "-v"],
} }
class QuantumMixin(object):
class QuantumUninstaller(comp.PkgUninstallComponent): def known_options(self):
def __init__(self, *args, **kargs): return set(['no-ovs-db-init', 'no-ovs-bridge-init'])
comp.PkgUninstallComponent.__init__(self, *args, **kargs)
def known_subsystems(self):
return set(['openvswitch'])
class QuantumInstaller(comp.PkgInstallComponent): def _get_config_files(self):
def __init__(self, *args, **kargs): return list(CONFIG_FILES)
comp.PkgInstallComponent.__init__(self, *args, **kargs)
self.q_vswitch_agent = False
self.q_vswitch_service = False
plugin = self.cfg.getdefaulted("quantum", "q_plugin", VSWITCH_PLUGIN)
if plugin == VSWITCH_PLUGIN:
# FIXME: Make these subsystems
self.q_vswitch_agent = True
self.q_vswitch_service = True
def _get_download_locations(self): def _get_download_locations(self):
places = list() places = list()
@ -85,11 +79,22 @@ class QuantumInstaller(comp.PkgInstallComponent):
}) })
return places return places
def known_options(self):
return set(['no-ovs-db-init', 'no-ovs-bridge-init'])
def _get_config_files(self): class QuantumUninstaller(QuantumMixin, comp.PkgUninstallComponent):
return list(CONFIG_FILES) def __init__(self, *args, **kargs):
comp.PkgUninstallComponent.__init__(self, *args, **kargs)
class QuantumInstaller(QuantumMixin, comp.PkgInstallComponent):
def __init__(self, *args, **kargs):
comp.PkgInstallComponent.__init__(self, *args, **kargs)
self.q_vswitch_agent = False
self.q_vswitch_service = False
plugin = self.cfg.getdefaulted("quantum", "q_plugin", VSWITCH_PLUGIN)
if plugin == VSWITCH_PLUGIN:
# FIXME: Make these subsystems
self.q_vswitch_agent = True
self.q_vswitch_service = True
def _get_target_config_name(self, config_fn): def _get_target_config_name(self, config_fn):
if config_fn == PLUGIN_CONF: if config_fn == PLUGIN_CONF:
@ -181,7 +186,7 @@ class QuantumInstaller(comp.PkgInstallComponent):
return comp.PkgInstallComponent._get_source_config(self, config_fn) return comp.PkgInstallComponent._get_source_config(self, config_fn)
class QuantumRuntime(comp.ProgramRuntime): class QuantumRuntime(QuantumMixin, comp.ProgramRuntime):
def __init__(self, *args, **kargs): def __init__(self, *args, **kargs):
comp.ProgramRuntime.__init__(self, *args, **kargs) comp.ProgramRuntime.__init__(self, *args, **kargs)
self.q_vswitch_agent = False self.q_vswitch_agent = False