From bec3f3a2147a4dea9684c70d04186169e704855b Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Wed, 23 Aug 2023 08:52:34 +0200 Subject: [PATCH] Remove hardcoded hypervisor_options values The default value of can_set_mount_point that we merge into the hypervisor_options parameter is not the Horizon default. This removes the defaults that sets the can_set_mount_point to true by default when Horizon has this as false by default, it's also only really functional on a very specific hypervisor. This also removes the can_set_password config that we set to False that already is the Horizon default. Change-Id: Iba05bce817da1c1bc51acb06b6bdc69beba2ea26 Signed-off-by: Tobias Urdin --- manifests/init.pp | 16 +++------------- ...oded-hypervisor-options-8ed400c16d54fe97.yaml | 6 ++++++ spec/classes/horizon_init_spec.rb | 2 -- templates/local_settings.py.erb | 4 ++-- 4 files changed, 11 insertions(+), 17 deletions(-) create mode 100644 releasenotes/notes/remove-hardcoded-hypervisor-options-8ed400c16d54fe97.yaml diff --git a/manifests/init.pp b/manifests/init.pp index a1aec1d7..ba3e5d02 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -173,12 +173,8 @@ # # [*hypervisor_options*] # (optional) A hash of parameters to enable features specific to -# Hypervisors. These include: -# 'can_set_mount_point': Boolean to enable or disable mount point setting -# Defaults to 'True'. -# 'can_set_password': Boolean to enable or disable VM password setting. -# Works only with Xen Hypervisor. -# Defaults to 'False'. +# Hypervisors. +# Defaults to {} # # [*cinder_options*] # (optional) A hash of parameters to enable features specific to @@ -683,16 +679,11 @@ class horizon( fail('websso_initial_choice is required when websso_choices_hide_keystone is true') } - $hypervisor_defaults = { - 'can_set_mount_point' => true, - 'can_set_password' => false, - } - # Default options for the OPENSTACK_CINDER_FEATURES section. These will # be merged with user-provided options when the local_settings.py.erb # template is interpolated. $cinder_defaults = { - 'enable_backup' => false, + 'enable_backup' => false, } # Default options for the OPENSTACK_KEYSTONE_BACKEND section. These will @@ -734,7 +725,6 @@ class horizon( Service <| title == 'memcached' |> -> Class['horizon'] - $hypervisor_options_real = merge($hypervisor_defaults,$hypervisor_options) $cinder_options_real = merge($cinder_defaults,$cinder_options) $keystone_options_real = merge($keystone_defaults, $keystone_options) $neutron_options_real = merge($neutron_defaults,$neutron_options) diff --git a/releasenotes/notes/remove-hardcoded-hypervisor-options-8ed400c16d54fe97.yaml b/releasenotes/notes/remove-hardcoded-hypervisor-options-8ed400c16d54fe97.yaml new file mode 100644 index 00000000..f1d6b352 --- /dev/null +++ b/releasenotes/notes/remove-hardcoded-hypervisor-options-8ed400c16d54fe97.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + The default value of the hypervisor_options parameter has been changed + to an empty hash and does no longer set can_set_mount_point to true by + default since this does not reflect the Horizon default value. diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index efeaa651..00bd3446 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -70,8 +70,6 @@ describe 'horizon' do "SECRET_KEY = secret_key.generate_or_read_from_file('#{platforms_params[:secret_key_file]}')", 'OPENSTACK_KEYSTONE_URL = "http://127.0.0.1:5000"', 'OPENSTACK_KEYSTONE_DEFAULT_ROLE = "member"', - " 'can_set_mount_point': True,", - " 'can_set_password': False,", " 'enable_distributed_router': False,", " 'enable_ha_router': False,", " 'enable_quotas': True,", diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb index 767e9b1d..9b6eb9a4 100644 --- a/templates/local_settings.py.erb +++ b/templates/local_settings.py.erb @@ -446,9 +446,9 @@ OPENSTACK_USE_SIMPLE_TENANT_USAGE = <%= @use_simple_tenant_usage.to_s.capitalize # The OPENSTACK_HYPERVISOR_FEATURES settings can be used to enable optional # services provided by hypervisors. -<%- if ! (@hypervisor_options_real.empty?) -%> +<%- if ! (@hypervisor_options.empty?) -%> OPENSTACK_HYPERVISOR_FEATURES = { -<%- @hypervisor_options_real.sort.each do |opt_name,opt_val| -%> +<%- @hypervisor_options.sort.each do |opt_name,opt_val| -%> '<%= opt_name -%>': <%= opt_val.to_s.capitalize -%>, <%-end-%> }