From 3cb02d8768cfbf6823f3453fc7ad87d99e6a430e Mon Sep 17 00:00:00 2001 From: Alexey Deryugin Date: Tue, 11 Oct 2016 16:28:44 +0300 Subject: [PATCH] Make swift_service_type configurable in guestagent.conf Change-Id: Id167b0dcf68fc6d9b211ecb9c6acbfaf4b1afead Closes-Bug: #1569658 --- manifests/guestagent.pp | 16 +++++++++++----- ...able_swift_service_type-9a9b3bab6ff5e185.yaml | 3 +++ spec/classes/trove_guestagent_spec.rb | 3 +++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/configurable_swift_service_type-9a9b3bab6ff5e185.yaml diff --git a/manifests/guestagent.pp b/manifests/guestagent.pp index 05167661..e7a5e430 100644 --- a/manifests/guestagent.pp +++ b/manifests/guestagent.pp @@ -47,6 +47,10 @@ # lookup the URL using the Keystone catalog. # Defaults to $::os_service_default. # +# [*swift_service_type*] +# (optional) Service type to use when searching catalog +# Defaults to $::os_service_default. +# # [*rabbit_hosts*] # (optional) List of clustered rabbit servers. # Defaults to the value set in the trove class. @@ -109,6 +113,7 @@ class trove::guestagent( $log_facility = $::os_service_default, $auth_url = 'http://localhost:5000/v2.0', $swift_url = $::os_service_default, + $swift_service_type = $::os_service_default, $rabbit_hosts = $::trove::rabbit_hosts, $rabbit_host = $::trove::rabbit_host, $rabbit_port = $::trove::rabbit_port, @@ -130,11 +135,12 @@ class trove::guestagent( # basic service config trove_guestagent_config { - 'DEFAULT/trove_auth_url': value => $auth_url; - 'DEFAULT/swift_url': value => $swift_url; - 'DEFAULT/root_grant': value => $root_grant; - 'DEFAULT/root_grant_option': value => $root_grant_option; - 'DEFAULT/default_password_length': value => $default_password_length; + 'DEFAULT/trove_auth_url': value => $auth_url; + 'DEFAULT/swift_url': value => $swift_url; + 'DEFAULT/swift_service_type': value => $swift_service_type; + 'DEFAULT/root_grant': value => $root_grant; + 'DEFAULT/root_grant_option': value => $root_grant_option; + 'DEFAULT/default_password_length': value => $default_password_length; } oslo::messaging::default { 'trove_guestagent_config': diff --git a/releasenotes/notes/configurable_swift_service_type-9a9b3bab6ff5e185.yaml b/releasenotes/notes/configurable_swift_service_type-9a9b3bab6ff5e185.yaml new file mode 100644 index 00000000..80585fcc --- /dev/null +++ b/releasenotes/notes/configurable_swift_service_type-9a9b3bab6ff5e185.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add ability to configure swift_service_type in guestagent.conf. diff --git a/spec/classes/trove_guestagent_spec.rb b/spec/classes/trove_guestagent_spec.rb index 5aa9c141..72fa2e68 100644 --- a/spec/classes/trove_guestagent_spec.rb +++ b/spec/classes/trove_guestagent_spec.rb @@ -48,6 +48,7 @@ describe 'trove::guestagent' do is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('') is_expected.to contain_trove_guestagent_config('DEFAULT/swift_url').with_value('') + is_expected.to contain_trove_guestagent_config('DEFAULT/swift_service_type').with_value('') is_expected.to contain_trove_guestagent_config('DEFAULT/root_grant').with_value('') is_expected.to contain_trove_guestagent_config('DEFAULT/root_grant_option').with_value('') is_expected.to contain_trove_guestagent_config('DEFAULT/default_password_length').with_value('') @@ -104,6 +105,7 @@ describe 'trove::guestagent' do let :params do { :auth_url => "http://10.0.0.1:5000/v2.0", :swift_url => "http://10.0.0.1:8080/v1/AUTH_", + :swift_service_type => 'object-store', :rabbit_host => '10.1.0.1', :rabbit_port => '5673', :rabbit_use_ssl => 'true' @@ -112,6 +114,7 @@ describe 'trove::guestagent' do it 'configures trove-guestagent with custom parameters' do is_expected.to contain_trove_guestagent_config('DEFAULT/trove_auth_url').with_value('http://10.0.0.1:5000/v2.0') is_expected.to contain_trove_guestagent_config('DEFAULT/swift_url').with_value('http://10.0.0.1:8080/v1/AUTH_') + is_expected.to contain_trove_guestagent_config('DEFAULT/swift_service_type').with_value('object-store') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_host').with_value('10.1.0.1') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_port').with_value('5673') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')