From b89d546beecb1c2eb4c6d36fb2020af8b9f6dad6 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 17 Jun 2014 09:43:30 +0100 Subject: [PATCH] Remove neutron- prefix from db info as this is a neutron charm so neutron is implicit --- config.yaml | 4 ++-- hooks/neutron_api_context.py | 2 +- hooks/neutron_api_hooks.py | 7 +++---- hooks/neutron_api_utils.py | 5 ++--- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/config.yaml b/config.yaml index 409d0156..393f820f 100644 --- a/config.yaml +++ b/config.yaml @@ -22,11 +22,11 @@ options: default: openstack type: string description: Rabbitmq vhost - neutron-database-user: + database-user: default: neutron type: string description: Username for Neutron database access (if enabled) - neutron-database: + database: default: neutron type: string description: Database name for Neutron (if enabled) diff --git a/hooks/neutron_api_context.py b/hooks/neutron_api_context.py index afdfec7b..eb325e42 100644 --- a/hooks/neutron_api_context.py +++ b/hooks/neutron_api_context.py @@ -11,7 +11,7 @@ class NeutronPostgresqlDBContext(context.PostgresqlDBContext): def __init__(self): super(NeutronPostgresqlDBContext, - self).__init__(config('neutron-database')) + self).__init__(config('database')) class IdentityServiceContext(context.IdentityServiceContext): diff --git a/hooks/neutron_api_hooks.py b/hooks/neutron_api_hooks.py index e408e8af..c7ed5ec2 100755 --- a/hooks/neutron_api_hooks.py +++ b/hooks/neutron_api_hooks.py @@ -98,9 +98,8 @@ def db_joined(): log(e, level=ERROR) raise Exception(e) - # XXX: Renaming relations from quantum_* to neutron_* here. - relation_set(neutron_database=config('neutron-database'), - neutron_username=config('neutron-database-user'), + relation_set(neutron_database=config('database'), + neutron_username=config('database-user'), neutron_hostname=unit_get('private-address')) @@ -113,7 +112,7 @@ def pgsql_neutron_db_joined(): log(e, level=ERROR) raise Exception(e) - relation_set(database=config('neutron-database')) + relation_set(database=config('database')) @hooks.hook('shared-db-relation-changed') diff --git a/hooks/neutron_api_utils.py b/hooks/neutron_api_utils.py index 8b7b5d88..d1fe22d1 100644 --- a/hooks/neutron_api_utils.py +++ b/hooks/neutron_api_utils.py @@ -50,9 +50,8 @@ BASE_RESOURCE_MAP = OrderedDict([ 'services': ['neutron-server'], 'contexts': [context.AMQPContext(ssl_dir=NEUTRON_CONF_DIR), context.SharedDBContext( - user=config('neutron-database-user'), - database=config('neutron-database'), - relation_prefix='neutron', + user=config('database-user'), + database=config('database'), ssl_dir=NEUTRON_CONF_DIR), neutron_api_context.NeutronPostgresqlDBContext(), neutron_api_context.IdentityServiceContext(),