Starting to add melange + client.

This commit is contained in:
Joshua Harlow 2012-02-04 20:41:27 -08:00
parent 3ecbbf7d9a
commit f629e703d1
7 changed files with 189 additions and 34 deletions

View File

@ -239,6 +239,14 @@ quantum_branch = master
quantum_client_repo = https://github.com/openstack/python-quantumclient.git
quantum_client_branch = master
# Melange service
melange_repo = https://github.com/openstack/melange.git
melange_branch = master
# Python melange client library
melangeclient_repo = https://github.com/openstack/python-melangeclient.git
melangeclient_branch = master
[quantum]
# Where your quantum host is at

View File

@ -0,0 +1,71 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from devstack import component as comp
from devstack import log as logging
from devstack import settings
from devstack import shell as sh
from devstack import utils
LOG = logging.getLogger("devstack.components.melange")
#id
TYPE = settings.MELANGE
#the pkg json files melange requires for installation
REQ_PKGS = ['general.json']
class MelangeUninstaller(comp.PythonUninstallComponent):
def __init__(self, *args, **kargs):
comp.PythonUninstallComponent.__init__(self, TYPE, *args, **kargs)
class MelangeInstaller(comp.PythonInstallComponent):
def __init__(self, *args, **kargs):
comp.PythonInstallComponent.__init__(self, TYPE, *args, **kargs)
def _get_download_locations(self):
places = list()
places.append({
'uri': ("git", "melange_repo"),
'branch': ("git", "melange_branch"),
})
return places
def _get_pkgs(self):
return list(REQ_PKGS)
class MelangeRuntime(comp.EmptyRuntime):
def __init__(self, *args, **kargs):
comp.EmptyRuntime.__init__(self, TYPE, *args, **kargs)
def describe(opts=None):
description = """
Module: {module_name}
Description:
{description}
Component options:
{component_opts}
"""
params = dict()
params['component_opts'] = "TBD"
params['module_name'] = __name__
params['description'] = __doc__ or "Handles actions for the melange component."
out = description.format(**params)
return out.strip("\n")

View File

@ -0,0 +1,71 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from devstack import component as comp
from devstack import log as logging
from devstack import settings
from devstack import shell as sh
from devstack import utils
LOG = logging.getLogger("devstack.components.melange_client")
#id
TYPE = settings.MELANGE_CLIENT
#the pkg json files melange client requires for installation
REQ_PKGS = ['general.json']
class MelangeClientUninstaller(comp.PythonUninstallComponent):
def __init__(self, *args, **kargs):
comp.PythonUninstallComponent.__init__(self, TYPE, *args, **kargs)
class MelangeClientInstaller(comp.PythonInstallComponent):
def __init__(self, *args, **kargs):
comp.PythonInstallComponent.__init__(self, TYPE, *args, **kargs)
def _get_download_locations(self):
places = list()
places.append({
'uri': ("git", "melangeclient_repo"),
'branch': ("git", "melangeclient_branch"),
})
return places
def _get_pkgs(self):
return list(REQ_PKGS)
class MelangeClientRuntime(comp.EmptyRuntime):
def __init__(self, *args, **kargs):
comp.EmptyRuntime.__init__(self, TYPE, *args, **kargs)
def describe(opts=None):
description = """
Module: {module_name}
Description:
{description}
Component options:
{component_opts}
"""
params = dict()
params['component_opts'] = "TBD"
params['module_name'] = __name__
params['description'] = __doc__ or "Handles actions for the melange client component."
out = description.format(**params)
return out.strip("\n")

View File

@ -70,11 +70,12 @@ class SwiftInstaller(comp.PythonInstallComponent):
self.auth_server = 'keystone'
def _get_download_locations(self):
return comp.PythonInstallComponent._get_download_locations(self) + [
{
places = list()
places.append({
'uri': ('git', 'swift_repo'),
'branch': ('git', 'swift_branch')
}]
})
return places
def _get_config_files(self):
return list(CONFIGS)

View File

@ -25,6 +25,8 @@ from devstack.components import glance
from devstack.components import horizon
from devstack.components import keystone
from devstack.components import keystone_client
from devstack.components import melange
from devstack.components import melange_client
from devstack.components import nova
from devstack.components import nova_client
from devstack.components import novnc
@ -37,67 +39,60 @@ from devstack.components import swift_keystone
# This determines what classes to use to install/uninstall/...
ACTION_CLASSES = {
settings.INSTALL: {
settings.NOVA: nova.NovaInstaller,
settings.DB: db.DBInstaller,
settings.GLANCE: glance.GlanceInstaller,
settings.QUANTUM: quantum.QuantumInstaller,
settings.SWIFT: swift.SwiftInstaller,
settings.SWIFT_KEYSTONE: swift_keystone.SwiftKeystoneInstaller,
settings.HORIZON: horizon.HorizonInstaller,
settings.KEYSTONE: keystone.KeystoneInstaller,
settings.DB: db.DBInstaller,
settings.RABBIT: rabbit.RabbitInstaller,
settings.KEYSTONE_CLIENT: keystone_client.KeyStoneClientInstaller,
settings.MELANGE: melange.MelangeInstaller,
settings.MELANGE_CLIENT: melange_client.MelangeClientInstaller,
settings.NOVA: nova.NovaInstaller,
settings.NOVA_CLIENT: nova_client.NovaClientInstaller,
settings.NOVNC: novnc.NoVNCInstaller,
settings.QUANTUM: quantum.QuantumInstaller,
settings.QUANTUM_CLIENT: quantum_client.QuantumClientInstaller,
settings.RABBIT: rabbit.RabbitInstaller,
settings.SWIFT: swift.SwiftInstaller,
settings.SWIFT_KEYSTONE: swift_keystone.SwiftKeystoneInstaller,
},
settings.UNINSTALL: {
settings.NOVA: nova.NovaUninstaller,
settings.DB: db.DBUninstaller,
settings.GLANCE: glance.GlanceUninstaller,
settings.QUANTUM: quantum.QuantumUninstaller,
settings.SWIFT: swift.SwiftUninstaller,
settings.SWIFT_KEYSTONE: swift_keystone.SwiftKeystoneUninstaller,
settings.HORIZON: horizon.HorizonUninstaller,
settings.KEYSTONE: keystone.KeystoneUninstaller,
settings.DB: db.DBUninstaller,
settings.RABBIT: rabbit.RabbitUninstaller,
settings.KEYSTONE_CLIENT: keystone_client.KeyStoneClientUninstaller,
settings.MELANGE: melange.MelangeUninstaller,
settings.MELANGE_CLIENT: melange_client.MelangeClientUninstaller,
settings.NOVA: nova.NovaUninstaller,
settings.NOVA_CLIENT: nova_client.NovaClientUninstaller,
settings.NOVNC: novnc.NoVNCUninstaller,
settings.QUANTUM: quantum.QuantumUninstaller,
settings.QUANTUM_CLIENT: quantum_client.QuantumClientUninstaller,
settings.RABBIT: rabbit.RabbitUninstaller,
settings.SWIFT: swift.SwiftUninstaller,
settings.SWIFT_KEYSTONE: swift_keystone.SwiftKeystoneUninstaller,
},
settings.START: {
settings.NOVA: nova.NovaRuntime,
settings.DB: db.DBRuntime,
settings.GLANCE: glance.GlanceRuntime,
settings.QUANTUM: quantum.QuantumRuntime,
settings.SWIFT: swift.SwiftRuntime,
settings.SWIFT_KEYSTONE: swift_keystone.SwiftKeystoneRuntime,
settings.HORIZON: horizon.HorizonRuntime,
settings.KEYSTONE: keystone.KeystoneRuntime,
settings.DB: db.DBRuntime,
settings.RABBIT: rabbit.RabbitRuntime,
settings.KEYSTONE_CLIENT: keystone_client.KeyStoneClientRuntime,
settings.MELANGE: melange.MelangeRuntime,
settings.MELANGE_CLIENT: melange_client.MelangeClientRuntime,
settings.NOVA: nova.NovaRuntime,
settings.NOVA_CLIENT: nova_client.NovaClientRuntime,
settings.NOVNC: novnc.NoVNCRuntime,
settings.QUANTUM_CLIENT: quantum_client.QuantumClientRuntime,
},
settings.STOP: {
settings.NOVA: nova.NovaRuntime,
settings.GLANCE: glance.GlanceRuntime,
settings.QUANTUM: quantum.QuantumRuntime,
settings.QUANTUM_CLIENT: quantum_client.QuantumClientRuntime,
settings.RABBIT: rabbit.RabbitRuntime,
settings.SWIFT: swift.SwiftRuntime,
settings.SWIFT_KEYSTONE: swift_keystone.SwiftKeystoneRuntime,
settings.HORIZON: horizon.HorizonRuntime,
settings.KEYSTONE: keystone.KeystoneRuntime,
settings.DB: db.DBRuntime,
settings.RABBIT: rabbit.RabbitRuntime,
settings.KEYSTONE_CLIENT: keystone_client.KeyStoneClientRuntime,
settings.NOVA_CLIENT: nova_client.NovaClientRuntime,
settings.NOVNC: novnc.NoVNCRuntime,
settings.QUANTUM_CLIENT: quantum_client.QuantumClientRuntime,
},
}
ACTION_CLASSES[settings.STOP] = ACTION_CLASSES[settings.START]
_FAKE_ROOT_DIR = tempfile.gettempdir()

View File

@ -48,6 +48,8 @@ DB = "db"
RABBIT = "rabbit"
NOVNC = 'novnc'
XVNC = 'xvnc'
MELANGE = 'melange'
MELANGE_CLIENT = 'melange-client'
COMPONENT_NAMES = [
NOVA, NOVA_CLIENT,
GLANCE,
@ -58,6 +60,7 @@ COMPONENT_NAMES = [
DB,
RABBIT,
NOVNC,
MELANGE, MELANGE_CLIENT,
]
# When a component is asked for it may
@ -80,6 +83,8 @@ COMPONENT_DEPENDENCIES = {
QUANTUM: [DB, QUANTUM_CLIENT],
NOVNC: [NOVA],
QUANTUM_CLIENT: [],
MELANGE: [],
MELANGE_CLIENT: [],
}
# Default subdirs of a components root directory

View File

@ -32,6 +32,8 @@ from devstack.components import glance
from devstack.components import horizon
from devstack.components import keystone
from devstack.components import keystone_client
from devstack.components import melange
from devstack.components import melange_client
from devstack.components import nova
from devstack.components import nova_client
from devstack.components import novnc
@ -58,6 +60,8 @@ _DESCR_MAP = {
settings.SWIFT_KEYSTONE: swift_keystone.describe,
settings.NOVNC: novnc.describe,
settings.QUANTUM_CLIENT: quantum_client.describe,
settings.MELANGE: melange.describe,
settings.MELANGE_CLIENT: melange_client.describe,
}