glance provider: pick os_region_name from DEFAULT

In ::glance::api, os_region_name is set in DEFAULT which work for both
Juno & Kilo.

'glance_store' section has been introduced in Kilo which breaks Juno.
Until we decide our policy to manage master, let's use DEFAULT so both
releases work well.

Change-Id: I1c519146d3fe62f8c8fc8c2d85805db11af21e4c
This commit is contained in:
Emilien Macchi 2015-04-24 15:31:14 -04:00
parent 9f345f97d1
commit b76fbcbea3
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ class Puppet::Provider::Glance < Puppet::Provider
glance_file['keystone_authtoken']['admin_tenant_name'] and
glance_file['keystone_authtoken']['admin_user'] and
glance_file['keystone_authtoken']['admin_password'] and
glance_file['glance_store']['os_region_name']
glance_file['DEFAULT']['os_region_name']
g = {}
g['auth_host'] = glance_file['keystone_authtoken']['auth_host'].strip
@ -25,7 +25,7 @@ class Puppet::Provider::Glance < Puppet::Provider
g['admin_tenant_name'] = glance_file['keystone_authtoken']['admin_tenant_name'].strip
g['admin_user'] = glance_file['keystone_authtoken']['admin_user'].strip
g['admin_password'] = glance_file['keystone_authtoken']['admin_password'].strip
g['os_region_name'] = glance_file['glance_store']['os_region_name'].strip
g['os_region_name'] = glance_file['DEFAULT']['os_region_name'].strip
# auth_admin_prefix not required to be set.
g['auth_admin_prefix'] = (glance_file['keystone_authtoken']['auth_admin_prefix'] || '').strip
@ -36,14 +36,14 @@ class Puppet::Provider::Glance < Puppet::Provider
glance_file['keystone_authtoken']['admin_tenant_name'] and
glance_file['keystone_authtoken']['admin_user'] and
glance_file['keystone_authtoken']['admin_password'] and
glance_file['glance_store']['os_region_name']
glance_file['DEFAULT']['os_region_name']
g = {}
g['identity_uri'] = glance_file['keystone_authtoken']['identity_uri'].strip
g['admin_tenant_name'] = glance_file['keystone_authtoken']['admin_tenant_name'].strip
g['admin_user'] = glance_file['keystone_authtoken']['admin_user'].strip
g['admin_password'] = glance_file['keystone_authtoken']['admin_password'].strip
g['os_region_name'] = glance_file['glance_store']['os_region_name'].strip
g['os_region_name'] = glance_file['DEFAULT']['os_region_name'].strip
return g
else

View File

@ -36,7 +36,7 @@ describe Puppet::Provider::Glance do
'admin_user' => 'user',
'admin_password' => 'pass'
},
'glance_store' =>
'DEFAULT' =>
{
'os_region_name' => 'SomeRegion',
}