adding postgresql to neutron
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user