]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Add default auth_uri setting for auth token.
authorDan Prince <dprince@redhat.com>
Thu, 29 Aug 2013 14:41:48 +0000 (10:41 -0400)
committerDan Prince <dprince@redhat.com>
Thu, 29 Aug 2013 14:41:48 +0000 (10:41 -0400)
The latest keystoneclient code now gives a Warning if auth_uri
isn't explicitly specified.

Change-Id: I0feb52f7a9140ea750254f80b6a3e6855b25f1d3

manifests/api.pp
spec/classes/ceilometer_api_spec.rb

index 786fa1d760bbb4dee1de9f08d43bddb596280d6c..8b76bcf4e940abe44f011eb19a02379791d670b6 100644 (file)
@@ -36,6 +36,7 @@ class ceilometer::api (
   $keystone_user              = 'ceilometer',
   $keystone_tenant            = 'services',
   $keystone_password          = false,
+  $keystone_auth_uri          = false,
 ) {
 
   include ceilometer::params
@@ -88,4 +89,14 @@ class ceilometer::api (
     }
   }
 
+  if $keystone_auth_uri {
+    ceilometer_config {
+      'keystone_authtoken/auth_uri': value => $keystone_auth_uri;
+    }
+  } else {
+    ceilometer_config {
+      'keystone_authtoken/auth_uri': value => "${keystone_protocol}://${keystone_host}:5000/";
+    }
+  }
+
 }
index 072d4bfe58ba5d6492092d9e60efe7e38d3f8c07..3d659f6c5de242f52a7dcd77758cc0ad2acb2df3 100644 (file)
@@ -53,6 +53,7 @@ describe 'ceilometer::api' do
       should contain_ceilometer_config('keystone_authtoken/admin_user').with_value( params[:keystone_user] )
       should contain_ceilometer_config('keystone_authtoken/admin_password').with_value( params[:keystone_password] )
       should contain_ceilometer_config('keystone_authtoken/auth_admin_prefix').with_ensure('absent')
+      should contain_ceilometer_config('keystone_authtoken/auth_uri').with_value( params[:keystone_protocol] + "://" + params[:keystone_host] + ":5000/" )
     end
 
     context 'when specifying keystone_auth_admin_prefix' do
@@ -104,4 +105,19 @@ describe 'ceilometer::api' do
 
     it_configures 'ceilometer-api'
   end
+
+  describe 'with custom auth_uri' do
+    let :facts do
+      { :osfamily => 'RedHat' }
+    end
+    before do
+      params.merge!({
+        :keystone_auth_uri => 'https://foo.bar:1234/',
+      })
+    end
+    it 'should configure custom auth_uri correctly' do
+      should contain_ceilometer_config('keystone_authtoken/auth_uri').with_value( 'https://foo.bar:1234/' )
+    end
+  end
+
 end