Stop collecting glance services by name

Collect glance service resources by title instead of name.  The service
name differs across distributions but the resource title does not.
These collectors were silently ignored when they did not match any
services on Red Hat systems.

Change-Id: I9c17395576b35920eda1f57d93ef684a00253c53
Closes-Bug: 1511891
This commit is contained in:
Doug Knight 2015-10-30 16:52:35 -08:00
parent 5b7b2b3c83
commit a530adfc79
2 changed files with 26 additions and 7 deletions

View File

@ -182,7 +182,7 @@ class glance::keystone::auth(
$real_service_name = pick($service_name, $auth_name)
if $configure_endpoint {
Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| name == 'glance-api' |>
Keystone_endpoint["${region}/${real_service_name}"] ~> Service<| title == 'glance-api' |>
Keystone_endpoint["${region}/${real_service_name}"] -> Glance_image<||>
}
@ -203,8 +203,8 @@ class glance::keystone::auth(
}
if $configure_user_role {
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'glance-registry' |>
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'glance-api' |>
Keystone_user_role["${auth_name}@${tenant}"] ~> Service<| title == 'glance-registry' |>
Keystone_user_role["${auth_name}@${tenant}"] ~> Service<| title == 'glance-api' |>
}
}

View File

@ -3,9 +3,7 @@ require 'spec_helper_acceptance'
describe 'glance class' do
context 'default parameters' do
it 'should work with no errors' do
pp= <<-EOS
pp= <<-EOS
include ::openstack_integration
include ::openstack_integration::repos
include ::openstack_integration::mysql
@ -41,8 +39,29 @@ describe 'glance class' do
is_public => 'yes',
source => 'http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img',
}
EOS
EOS
it 'should configure the glance endpoint before the glance-api service uses it' do
pp2 = pp + "Service['glance-api'] -> Keystone_endpoint['RegionOne/glance']"
expect(apply_manifest(pp2, :expect_failures => true, :noop => true).stderr).to match(/Found 1 dependency cycle/i)
end
it 'should configure the glance user before the glance-api service uses it' do
pp2 = pp + "Service['glance-api'] -> Keystone_user_role['glance@services']"
expect(apply_manifest(pp2, :expect_failures => true, :noop => true).stderr).to match(/Found 1 dependency cycle/i)
end
it 'should configure the glance user before the glance-registry service uses it' do
pp2 = pp + "Service['glance-registry'] -> Keystone_user_role['glance@services']"
expect(apply_manifest(pp2, :expect_failures => true, :noop => true).stderr).to match(/Found 1 dependency cycle/i)
end
it 'should configure the glance-api service before using it to provision glance_images' do
pp2 = pp + "Glance_image['test_image'] -> Service['glance-api']"
expect(apply_manifest(pp2, :expect_failures => true, :noop => true).stderr).to match(/Found 1 dependency cycle/i)
end
it 'should work with no errors' do
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)