Add missing region setting in service_credentials
This change adds the missing region setting in service_credentials. In a shared keystone multi region setup, this setting is mandatory in order for ceilometer to properly find the services it relies upon from the same region it resides in. Without this setting, the ceilometer-upgrade action will fail (along with any other calls made to ceilometer) if the first endpoint returned by keystone is from a different region. Change-Id: Ie14df0f5fc7ee18072091dbdb3ada817615a6670 Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
a4ffe0e28c
commit
642d38c582
|
@ -113,6 +113,7 @@ class CeilometerContext(OSContextGenerator):
|
||||||
'polling_interval': int(config('polling-interval')),
|
'polling_interval': int(config('polling-interval')),
|
||||||
'enable_all_pollsters': config('enable-all-pollsters'),
|
'enable_all_pollsters': config('enable-all-pollsters'),
|
||||||
'polling_batch_size': config('polling-batch-size'),
|
'polling_batch_size': config('polling-batch-size'),
|
||||||
|
'region': config('region'),
|
||||||
}
|
}
|
||||||
return ctxt
|
return ctxt
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ auth_url = {{ service_protocol }}://{{ service_host }}:{{ service_port }}
|
||||||
project_name = {{ admin_tenant_name }}
|
project_name = {{ admin_tenant_name }}
|
||||||
username = {{ admin_user }}
|
username = {{ admin_user }}
|
||||||
password = {{ admin_password }}
|
password = {{ admin_password }}
|
||||||
|
region_name = {{ region }}
|
||||||
{% if api_version == "3" -%}
|
{% if api_version == "3" -%}
|
||||||
project_domain_name = {{ admin_domain_name }}
|
project_domain_name = {{ admin_domain_name }}
|
||||||
user_domain_name = {{ admin_domain_name }}
|
user_domain_name = {{ admin_domain_name }}
|
||||||
|
|
|
@ -128,6 +128,7 @@ class CeilometerContextsTest(CharmTestCase):
|
||||||
secret.return_value = 'mysecret'
|
secret.return_value = 'mysecret'
|
||||||
self.assertEqual(contexts.CeilometerContext()(), {
|
self.assertEqual(contexts.CeilometerContext()(), {
|
||||||
'port': 8777,
|
'port': 8777,
|
||||||
|
'region': 'RegionOne',
|
||||||
'metering_secret': 'mysecret',
|
'metering_secret': 'mysecret',
|
||||||
'metering_time_to_live': -1,
|
'metering_time_to_live': -1,
|
||||||
'event_time_to_live': -1,
|
'event_time_to_live': -1,
|
||||||
|
@ -144,6 +145,7 @@ class CeilometerContextsTest(CharmTestCase):
|
||||||
context = contexts.CeilometerContext()()
|
context = contexts.CeilometerContext()()
|
||||||
self.assertEqual(context, {
|
self.assertEqual(context, {
|
||||||
'port': 8777,
|
'port': 8777,
|
||||||
|
'region': 'RegionOne',
|
||||||
'metering_secret': 'mysecret',
|
'metering_secret': 'mysecret',
|
||||||
'metering_time_to_live': 7776000,
|
'metering_time_to_live': 7776000,
|
||||||
'event_time_to_live': 7776000,
|
'event_time_to_live': 7776000,
|
||||||
|
@ -161,6 +163,7 @@ class CeilometerContextsTest(CharmTestCase):
|
||||||
context = contexts.CeilometerContext()()
|
context = contexts.CeilometerContext()()
|
||||||
self.assertEqual(context, {
|
self.assertEqual(context, {
|
||||||
'port': 8777,
|
'port': 8777,
|
||||||
|
'region': 'RegionOne',
|
||||||
'metering_secret': 'mysecret',
|
'metering_secret': 'mysecret',
|
||||||
'metering_time_to_live': -1,
|
'metering_time_to_live': -1,
|
||||||
'event_time_to_live': -1,
|
'event_time_to_live': -1,
|
||||||
|
@ -176,6 +179,7 @@ class CeilometerContextsTest(CharmTestCase):
|
||||||
context = contexts.CeilometerContext()()
|
context = contexts.CeilometerContext()()
|
||||||
self.assertEqual(context, {
|
self.assertEqual(context, {
|
||||||
'port': 8777,
|
'port': 8777,
|
||||||
|
'region': 'RegionOne',
|
||||||
'metering_secret': 'mysecret',
|
'metering_secret': 'mysecret',
|
||||||
'metering_time_to_live': -1,
|
'metering_time_to_live': -1,
|
||||||
'event_time_to_live': -1,
|
'event_time_to_live': -1,
|
||||||
|
|
Loading…
Reference in New Issue