From 5f60b10eeb9616156bfd06113e6f52d01f6a26b4 Mon Sep 17 00:00:00 2001 From: Yaguang Tang Date: Sat, 8 Jul 2017 22:35:38 +0800 Subject: [PATCH] Removes Ironic deprecated authtoken options and tests Change-Id: Id9b8cb6c4a42fb96547c016301ba3a54ce5d5648 --- manifests/ironic/common.pp | 43 ++----------------- ..._ironic_auth_options-9e3a7afc21b2037d.yaml | 3 ++ spec/classes/nova_ironic_common_spec.rb | 20 --------- 3 files changed, 7 insertions(+), 59 deletions(-) create mode 100644 releasenotes/notes/remove_deprecated_ironic_auth_options-9e3a7afc21b2037d.yaml diff --git a/manifests/ironic/common.pp b/manifests/ironic/common.pp index e3671a6aa..f38393af5 100644 --- a/manifests/ironic/common.pp +++ b/manifests/ironic/common.pp @@ -57,55 +57,20 @@ class nova::ironic::common ( $username = 'admin', $api_max_retries = $::os_service_default, $api_retry_interval = $::os_service_default, - # DEPRECATED - $admin_username = undef, - $admin_password = undef, - $admin_tenant_name = undef, - $admin_url = undef, ) { include ::nova::deps - if ($admin_username) { - warning('nova::ironic::common::admin_username is deprecated. Please use username') - } - - if ($admin_password) { - warning('nova::ironic::common::admin_password is deprecated. Please use password') - } - - if ($admin_tenant_name) { - warning('nova::ironic::common::admin_tenant_name is deprecated. Please use project_name') - } - - if ($admin_url) { - warning('nova::ironic::common::admin_url is deprecated. Please use auth_url') - } - - - - $username_real = pick($admin_username, $username) - $password_real = pick($admin_password, $password) - $auth_url_real = pick($admin_url, $auth_url) - $project_name_real = pick($admin_tenant_name, $project_name) - nova_config { 'ironic/auth_plugin': value => $auth_plugin; - 'ironic/username': value => $username_real; - 'ironic/password': value => $password_real; - 'ironic/auth_url': value => $auth_url_real; - 'ironic/project_name': value => $project_name_real; + 'ironic/username': value => $username; + 'ironic/password': value => $password; + 'ironic/auth_url': value => $auth_url; + 'ironic/project_name': value => $project_name; 'ironic/api_endpoint': value => $api_endpoint; 'ironic/api_max_retries': value => $api_max_retries; 'ironic/api_retry_interval': value => $api_retry_interval; } - # TODO(aschultz): these are deprecated, remove in P - nova_config { - 'ironic/admin_username': value => $username_real; - 'ironic/admin_password': value => $password_real; - 'ironic/admin_url': value => $auth_url_real; - 'ironic/admin_tenant_name': value => $project_name_real; - } } diff --git a/releasenotes/notes/remove_deprecated_ironic_auth_options-9e3a7afc21b2037d.yaml b/releasenotes/notes/remove_deprecated_ironic_auth_options-9e3a7afc21b2037d.yaml new file mode 100644 index 000000000..d3eb53da8 --- /dev/null +++ b/releasenotes/notes/remove_deprecated_ironic_auth_options-9e3a7afc21b2037d.yaml @@ -0,0 +1,3 @@ +--- +upgrade: + - Removes Ironic deprecated admin_* authtoken options. diff --git a/spec/classes/nova_ironic_common_spec.rb b/spec/classes/nova_ironic_common_spec.rb index 4462a76df..7be77e676 100644 --- a/spec/classes/nova_ironic_common_spec.rb +++ b/spec/classes/nova_ironic_common_spec.rb @@ -15,10 +15,6 @@ describe 'nova::ironic::common' do is_expected.to contain_nova_config('ironic/api_max_retries').with('value' => '') is_expected.to contain_nova_config('ironic/api_retry_interval').with('value' => '') - is_expected.to contain_nova_config('ironic/admin_username').with_value('admin') - is_expected.to contain_nova_config('ironic/admin_password').with_value('ironic') - is_expected.to contain_nova_config('ironic/admin_url').with_value('http://127.0.0.1:35357/') - is_expected.to contain_nova_config('ironic/admin_tenant_name').with_value('services') end end @@ -45,35 +41,19 @@ describe 'nova::ironic::common' do is_expected.to contain_nova_config('ironic/api_max_retries').with('value' => '60') is_expected.to contain_nova_config('ironic/api_retry_interval').with('value' => '2') - is_expected.to contain_nova_config('ironic/admin_username').with_value('ironic') - is_expected.to contain_nova_config('ironic/admin_password').with_value('s3cr3t') - is_expected.to contain_nova_config('ironic/admin_url').with_value('http://10.0.0.10:35357/') - is_expected.to contain_nova_config('ironic/admin_tenant_name').with_value('services2') end end context 'with deprecated parameters' do let :params do { - :admin_username => 'ironic', - :admin_password => 's3cr3t', - :admin_url => 'http://10.0.0.10:35357/v2.0', - :admin_tenant_name => 'services2', :api_endpoint => 'http://10.0.0.10:6385/v1', } end it 'configures ironic in nova.conf' do - is_expected.to contain_nova_config('ironic/username').with_value('ironic') - is_expected.to contain_nova_config('ironic/password').with_value('s3cr3t') - is_expected.to contain_nova_config('ironic/auth_url').with_value('http://10.0.0.10:35357/v2.0') - is_expected.to contain_nova_config('ironic/project_name').with_value('services2') is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://10.0.0.10:6385/v1') - is_expected.to contain_nova_config('ironic/admin_username').with_value('ironic') - is_expected.to contain_nova_config('ironic/admin_password').with_value('s3cr3t') - is_expected.to contain_nova_config('ironic/admin_url').with_value('http://10.0.0.10:35357/v2.0') - is_expected.to contain_nova_config('ironic/admin_tenant_name').with_value('services2') end end end