From 992a5c78af24fc3f93cb56cc807e3489080a1e4b Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Thu, 29 Mar 2012 13:32:29 -0700 Subject: [PATCH] Setup mixin for novnc component --- devstack/components/nova.py | 4 ++-- devstack/components/novnc.py | 32 +++++++++++++++++--------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/devstack/components/nova.py b/devstack/components/nova.py index 1e103f27..63f512cf 100644 --- a/devstack/components/nova.py +++ b/devstack/components/nova.py @@ -547,8 +547,8 @@ class NovaConfConfigurator(object): elif drive_canon == 'libvirt': flat_interface = self._getstr('flat_interface') if flat_interface and not utils.is_interface(flat_interface): - msg = "Libvirt flat interface %s is not a known interface" % (flat_interface) - raise exceptions.ConfigException(msg) + msg = "Libvirt flat interface %s is not a known interface" % (flat_interface) + raise exceptions.ConfigException(msg) def configure(self): # Everything built goes in here diff --git a/devstack/components/novnc.py b/devstack/components/novnc.py index 977d77be..c10b3af6 100644 --- a/devstack/components/novnc.py +++ b/devstack/components/novnc.py @@ -33,17 +33,9 @@ APP_OPTIONS = { } -class NoVNCUninstaller(comp.PythonUninstallComponent): - def __init__(self, *args, **kargs): - comp.PythonUninstallComponent.__init__(self, *args, **kargs) - - -class NoVNCInstaller(comp.PythonInstallComponent): - def __init__(self, *args, **kargs): - comp.PythonInstallComponent.__init__(self, *args, **kargs) - - def _get_python_directories(self): - return dict() +class NoVNCMixin(object): + def known_options(self): + return set(['nova']) def _get_download_locations(self): places = list() @@ -54,7 +46,20 @@ class NoVNCInstaller(comp.PythonInstallComponent): 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): comp.ProgramRuntime.__init__(self, *args, **kargs) @@ -67,9 +72,6 @@ class NoVNCRuntime(comp.ProgramRuntime): }) return apps - def known_options(self): - return set(['nova']) - def _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: