Setup mixin for novnc component

This commit is contained in:
Joshua Harlow 2012-03-29 13:32:29 -07:00
parent 63e0384de5
commit 992a5c78af
2 changed files with 19 additions and 17 deletions

View File

@ -547,8 +547,8 @@ class NovaConfConfigurator(object):
elif drive_canon == 'libvirt': elif drive_canon == 'libvirt':
flat_interface = self._getstr('flat_interface') flat_interface = self._getstr('flat_interface')
if flat_interface and not utils.is_interface(flat_interface): if flat_interface and not utils.is_interface(flat_interface):
msg = "Libvirt flat interface %s is not a known interface" % (flat_interface) msg = "Libvirt flat interface %s is not a known interface" % (flat_interface)
raise exceptions.ConfigException(msg) raise exceptions.ConfigException(msg)
def configure(self): def configure(self):
# Everything built goes in here # Everything built goes in here

View File

@ -33,17 +33,9 @@ APP_OPTIONS = {
} }
class NoVNCUninstaller(comp.PythonUninstallComponent): class NoVNCMixin(object):
def __init__(self, *args, **kargs): def known_options(self):
comp.PythonUninstallComponent.__init__(self, *args, **kargs) return set(['nova'])
class NoVNCInstaller(comp.PythonInstallComponent):
def __init__(self, *args, **kargs):
comp.PythonInstallComponent.__init__(self, *args, **kargs)
def _get_python_directories(self):
return dict()
def _get_download_locations(self): def _get_download_locations(self):
places = list() places = list()
@ -54,7 +46,20 @@ class NoVNCInstaller(comp.PythonInstallComponent):
return places return places
class NoVNCRuntime(comp.ProgramRuntime): class NoVNCUninstaller(NoVNCMixin, comp.PythonUninstallComponent):
def __init__(self, *args, **kargs):
comp.PythonUninstallComponent.__init__(self, *args, **kargs)
class NoVNCInstaller(NoVNCMixin, comp.PythonInstallComponent):
def __init__(self, *args, **kargs):
comp.PythonInstallComponent.__init__(self, *args, **kargs)
def _get_python_directories(self):
return dict()
class NoVNCRuntime(NoVNCMixin, comp.ProgramRuntime):
def __init__(self, *args, **kargs): def __init__(self, *args, **kargs):
comp.ProgramRuntime.__init__(self, *args, **kargs) comp.ProgramRuntime.__init__(self, *args, **kargs)
@ -67,9 +72,6 @@ class NoVNCRuntime(comp.ProgramRuntime):
}) })
return apps return apps
def known_options(self):
return set(['nova'])
def _get_param_map(self, app_name): def _get_param_map(self, app_name):
root_params = comp.ProgramRuntime._get_param_map(self, app_name) root_params = comp.ProgramRuntime._get_param_map(self, app_name)
if app_name == VNC_PROXY_APP and 'nova' in self.options: if app_name == VNC_PROXY_APP and 'nova' in self.options: