From 7a50727f070e5482afb2642b27f8fe9880324c17 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 13 Aug 2025 01:33:54 +0900 Subject: [PATCH] Make sure credential options are cleared by default Change-Id: I432035bf745990f42374fa7e9881ac8ec3291192 Signed-off-by: Takashi Kajinami --- manifests/init.pp | 36 +++++++++++++++---------------- spec/classes/tempest_init_spec.rb | 32 +++++++++++++-------------- 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 13cb2ff5..4fd96678 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -53,31 +53,31 @@ # [*http_timeout*] # Defaults to $facts['os_service_default'] # [*username*] -# Defaults to undef +# Defaults to $facts['os_service_default'] # [*password*] -# Defaults to undef +# Defaults to $facts['os_service_default'] # [*project_name*] -# Defaults to undef +# Defaults to $facts['os_service_default'] # [*user_domain_name*] # Defaults to $facts['os_service_default'] # [*project_domain_name*] # Defaults to $facts['os_service_default'] # [*alt_username*] -# Defaults to undef +# Defaults to $facts['os_service_default'] # [*alt_password*] -# Defaults to undef +# Defaults to $facts['os_service_default'] # [*alt_project_name*] -# Defaults to undef +# Defaults to $facts['os_service_default'] # [*alt_user_domain_name*] # Defaults to $facts['os_service_default'] # [*alt_project_domain_name*] # Defaults to $facts['os_service_default'] # [*admin_username*] -# Defaults to undef +# Defaults to $facts['os_service_default'] # [*admin_password*] -# Defaults to undef +# Defaults to $facts['os_service_default'] # [*admin_project_name*] -# Defaults to undef +# Defaults to $facts['os_service_default'] # [*admin_role*] # Defaults to $facts['os_service_default'] # [*admin_domain_name*] @@ -394,21 +394,21 @@ class tempest( $logging_context_format_string = $facts['os_service_default'], $http_timeout = $facts['os_service_default'], # non admin user - $username = undef, - $password = undef, - $project_name = undef, + $username = $facts['os_service_default'], + $password = $facts['os_service_default'], + $project_name = $facts['os_service_default'], $user_domain_name = $facts['os_service_default'], $project_domain_name = $facts['os_service_default'], # another non-admin user - $alt_username = undef, - $alt_password = undef, - $alt_project_name = undef, + $alt_username = $facts['os_service_default'], + $alt_password = $facts['os_service_default'], + $alt_project_name = $facts['os_service_default'], $alt_user_domain_name = $facts['os_service_default'], $alt_project_domain_name = $facts['os_service_default'], # admin user - $admin_username = undef, - $admin_password = undef, - $admin_project_name = undef, + $admin_username = $facts['os_service_default'], + $admin_password = $facts['os_service_default'], + $admin_project_name = $facts['os_service_default'], $admin_role = $facts['os_service_default'], $admin_domain_name = $facts['os_service_default'], $admin_user_domain_name = $facts['os_service_default'], diff --git a/spec/classes/tempest_init_spec.rb b/spec/classes/tempest_init_spec.rb index 7cc393fc..7670e9ce 100644 --- a/spec/classes/tempest_init_spec.rb +++ b/spec/classes/tempest_init_spec.rb @@ -195,8 +195,8 @@ describe 'tempest' do is_expected.to contain_tempest_config('auth/admin_user_domain_name').with(:value => '') is_expected.to contain_tempest_config('auth/default_credentials_domain_name').with(:value => '') is_expected.to contain_tempest_config('auth/admin_password').with_secret( true ) - is_expected.to contain_tempest_config('auth/admin_project_name').with(:value => nil) - is_expected.to contain_tempest_config('auth/admin_username').with(:value => nil) + is_expected.to contain_tempest_config('auth/admin_project_name').with(:value => '') + is_expected.to contain_tempest_config('auth/admin_username').with(:value => '') is_expected.to contain_tempest_config('auth/admin_system').with(:value => '') is_expected.to contain_tempest_config('auth/tempest_roles').with(:value => '') is_expected.to contain_tempest_config('auth/use_dynamic_credentials').with(:value => '') @@ -223,16 +223,15 @@ describe 'tempest' do is_expected.to contain_tempest_config('validation/ssh_key_type').with(:value => '') is_expected.to contain_tempest_config('identity/admin_role').with(:value => '') is_expected.to contain_tempest_config('identity/auth_version').with(:value => '') - is_expected.to contain_tempest_config('identity/alt_password').with(:value => nil) - is_expected.to contain_tempest_config('identity/alt_password').with_secret( true ) - is_expected.to contain_tempest_config('identity/alt_project_name').with(:value => nil) - is_expected.to contain_tempest_config('identity/alt_username').with(:value => nil) + is_expected.to contain_tempest_config('identity/alt_password').with(:value => '') + is_expected.to contain_tempest_config('identity/alt_password').with(:value => '').with_secret( true ) + is_expected.to contain_tempest_config('identity/alt_project_name').with(:value => '') + is_expected.to contain_tempest_config('identity/alt_username').with(:value => '') is_expected.to contain_tempest_config('identity/alt_project_domain_name').with(:value => '') is_expected.to contain_tempest_config('identity/alt_user_domain_name').with(:value => '') - is_expected.to contain_tempest_config('identity/password').with(:value => nil) - is_expected.to contain_tempest_config('identity/password').with_secret( true ) - is_expected.to contain_tempest_config('identity/project_name').with(:value => nil) - is_expected.to contain_tempest_config('identity/username').with(:value => nil) + is_expected.to contain_tempest_config('identity/password').with(:value => '').with_secret(true) + is_expected.to contain_tempest_config('identity/project_name').with(:value => '') + is_expected.to contain_tempest_config('identity/username').with(:value => '') is_expected.to contain_tempest_config('identity/project_domain_name').with(:value => '') is_expected.to contain_tempest_config('identity/user_domain_name').with(:value => '') is_expected.to contain_tempest_config('identity/uri').with(:value => '') @@ -314,15 +313,14 @@ describe 'tempest' do is_expected.to contain_tempest_config('dns/nameservers').with(:value => '') is_expected.to contain_tempest_config('heat_plugin/auth_url').with(:value => '') is_expected.to contain_tempest_config('heat_plugin/auth_version').with(:value => '') - is_expected.to contain_tempest_config('heat_plugin/admin_password').with_secret( true ) - is_expected.to contain_tempest_config('heat_plugin/admin_project_name').with(:value => nil) - is_expected.to contain_tempest_config('heat_plugin/admin_username').with(:value => nil) + is_expected.to contain_tempest_config('heat_plugin/admin_password').with(:value => '').with_secret( true ) + is_expected.to contain_tempest_config('heat_plugin/admin_project_name').with(:value => '') + is_expected.to contain_tempest_config('heat_plugin/admin_username').with(:value => '') is_expected.to contain_tempest_config('heat_plugin/admin_project_domain_name').with(:value => '') is_expected.to contain_tempest_config('heat_plugin/admin_user_domain_name').with(:value => '') - is_expected.to contain_tempest_config('heat_plugin/password').with(:value => nil) - is_expected.to contain_tempest_config('heat_plugin/password').with_secret( true ) - is_expected.to contain_tempest_config('heat_plugin/project_name').with(:value => nil) - is_expected.to contain_tempest_config('heat_plugin/username').with(:value => nil) + is_expected.to contain_tempest_config('heat_plugin/password').with(:value => '').with_secret(true) + is_expected.to contain_tempest_config('heat_plugin/project_name').with(:value => '') + is_expected.to contain_tempest_config('heat_plugin/username').with(:value => '') is_expected.to contain_tempest_config('heat_plugin/image_ref').with(:value => nil) is_expected.to contain_tempest_config('heat_plugin/instance_type').with(:value => nil) is_expected.to contain_tempest_config('heat_plugin/minimal_image_ref').with(:value => nil)