added database type

This commit is contained in:
yolanda.robla@canonical.com 2014-03-20 10:31:25 +01:00
parent 4ed0e0560b
commit 70e61d50fd
7 changed files with 17 additions and 6 deletions

View File

@ -163,3 +163,14 @@ class IdentityServiceContext(context.IdentityServiceContext):
ctxt['service_port'])
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

View File

@ -84,7 +84,7 @@ BASE_RESOURCE_MAP = OrderedDict([
(NOVA_CONF, {
'services': BASE_SERVICES,
'contexts': [context.AMQPContext(),
context.SharedDBContext(relation_prefix='nova'),
nova_cc_context.SharedDBContext(relation_prefix='nova'),
context.ImageServiceContext(),
context.OSConfigFlagContext(),
context.SubordinateConfigContext(

View File

@ -16,7 +16,7 @@
--verbose
--ec2_private_dns_show_ip
{% if database_host -%}
--sql_connection=mysql://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
--sql_connection={{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
{% endif -%}
{% if rabbitmq_host -%}
--rabbit_host={{ rabbitmq_host }}

View File

@ -25,7 +25,7 @@ keystone_ec2_url = {{ keystone_ec2_url }}
{% endif -%}
{% if database_host -%}
sql_connection = mysql://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
sql_connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
{% endif -%}
{% if rabbitmq_host -%}

View File

@ -11,7 +11,7 @@ local_ip = {{ local_ip }}
[DATABASE]
{% if database_host -%}
sql_connection = mysql://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}?quantum?charset=utf8
sql_connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}?quantum?charset=utf8
reconnect_interval = 2
{% else -%}
connection = sqlite:////var/lib/quantum/quantum.sqlite

View File

@ -12,7 +12,7 @@ default_l3_gw_service_uuid = {{ nvp_l3_uuid }}
[database]
{% if database_host -%}
connection = mysql://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
{% else -%}
connection = sqlite:////var/lib/neutron/neutron.sqlite
{% endif -%}

View File

@ -6,7 +6,7 @@ local_ip = {{ local_ip }}
[database]
{% if database_host -%}
connection = mysql://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
{% else -%}
connection = sqlite:////var/lib/neutron/neutron.sqlite
{% endif -%}