adding postgresql to neutron

This commit is contained in:
yolanda.robla@canonical.com
2014-03-20 14:54:08 +01:00
parent 890b904f99
commit f8a29467b1
3 changed files with 8 additions and 10 deletions

View File

@@ -146,6 +146,7 @@ class SharedDBContext(OSContextGenerator):
'database': self.database,
'database_user': self.user,
'database_password': passwd,
'database_type': 'mysql'
}
if context_complete(ctxt):
return ctxt

View File

@@ -164,15 +164,6 @@ class IdentityServiceContext(context.IdentityServiceContext):
ctxt['keystone_ec2_url'] = ec2_tokens
return ctxt
class SharedDBContext(context.SharedDBContext):
interfaces = ['shared-db']
def __call__(self):
# add database type
ctxt = super(SharedDBContext, self).__call__()
ctxt['database_type'] = 'mysql'
return ctxt
class NovaPostgresqlDBContext(context.PostgresqlDBContext):
interfaces = ['pgsql-nova-db']

View File

@@ -29,6 +29,7 @@ from charmhelpers.fetch import (
from charmhelpers.core.hookenv import (
config,
log,
is_relation_made,
relation_get,
relation_ids,
remote_unit,
@@ -85,7 +86,7 @@ BASE_RESOURCE_MAP = OrderedDict([
(NOVA_CONF, {
'services': BASE_SERVICES,
'contexts': [context.AMQPContext(),
nova_cc_context.SharedDBContext(relation_prefix='nova'),
context.SharedDBContext(relation_prefix='nova'),
nova_cc_context.NovaPostgresqlDBContext(),
nova_cc_context.NeutronPostgresqlDBContext(),
context.ImageServiceContext(),
@@ -195,6 +196,11 @@ def resource_map():
resource_map[conf]['contexts'].append(
nova_cc_context.NeutronCCContext())
# update for postgres
if is_relation_made('pgsql-neutron-db'):
resource_map[conf]['contexts'].append(
context.PostgresqlDBContext())
# nova-conductor for releases >= G.
if os_release('nova-common') not in ['essex', 'folsom']:
resource_map['/etc/nova/nova.conf']['services'] += ['nova-conductor']