From c3eefcb86ef4d3b94d8ea5c4420450cbe38ceaea Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Thu, 26 Apr 2018 15:12:09 +0200 Subject: [PATCH] Remove deprecated parameters These parameters has been deprecated for more than two years. Let's remove them and add release notes. Change-Id: I229f49ac4ce02e0b1ddbd0a2f111739ce3059f37 Closes-Bug: 1767114 --- manifests/init.pp | 60 +------------------ manifests/wsgi/apache.pp | 15 +---- ...ve-deprecated-params-c788c10d6468657c.yaml | 14 +++++ spec/classes/horizon_init_spec.rb | 7 +-- spec/classes/horizon_wsgi_apache_spec.rb | 10 ++-- templates/local_settings.py.erb | 16 +---- 6 files changed, 27 insertions(+), 95 deletions(-) create mode 100644 releasenotes/notes/rocky-remove-deprecated-params-c788c10d6468657c.yaml diff --git a/manifests/init.pp b/manifests/init.pp index d52ada1a..28989a3f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -404,37 +404,6 @@ # will disable the function in Horizon, direct will allow the user agent to directly # talk to the glance-api. # -# -# === DEPRECATED group/name -# -# [*fqdn*] -# (optional) DEPRECATED, use allowed_hosts and server_aliases instead. -# FQDN(s) used to access Horizon. This is used by Django for -# security reasons. Can be set to * in environments where security is -# deemed unimportant. Also used for Server Aliases in web configs. -# Defaults to undef -# -# [*custom_theme_path*] -# (optional) The directory location for the theme (e.g., "static/themes/blue") -# Default to undef -# -# [*tuskar_ui*] -# (optional) Boolean to enable Tuskar-UI related configuration (http://tuskar-ui.readthedocs# -# Defaults to undef -# -# [*tuskar_ui_ironic_discoverd_url*] -# (optional) Tuskar-UI - Ironic Discoverd API endpoint -# Defaults to undef -# -# [*tuskar_ui_undercloud_admin_password*] -# (optional) Tuskar-UI - Undercloud admin password used to authenticate admin user in Tuskar# -# It is required by Heat to perform certain actions. -# Defaults to undef -# -# [*tuskar_ui_deployment_mode*] -# (optional) Tuskar-UI - Deployment mode ('poc' or 'scale') -# Defaults to undef -# # === Examples # # class { 'horizon': @@ -517,13 +486,6 @@ class horizon( $enable_user_pass = true, $customization_module = undef, $horizon_upload_mode = undef, - # DEPRECATED PARAMETERS - $custom_theme_path = undef, - $fqdn = undef, - $tuskar_ui = undef, - $tuskar_ui_ironic_discoverd_url = undef, - $tuskar_ui_undercloud_admin_password = undef, - $tuskar_ui_deployment_mode = undef, ) inherits ::horizon::params { $hypervisor_defaults = { @@ -531,26 +493,6 @@ class horizon( 'can_set_password' => false, } - if $fqdn { - - warning("Parameter fqdn is deprecated. Please use parameter allowed_hosts for setting ALLOWED_HOSTS in \ -settings_local.py and parameter server_aliases for setting ServerAlias directives in vhost.conf.") - - $final_allowed_hosts = $fqdn - $final_server_aliases = $fqdn - } else { - $final_allowed_hosts = $allowed_hosts - $final_server_aliases = $server_aliases - } - - if $custom_theme_path { - warning('custom_theme_path has been deprecated in mitaka and will be removed in a future release.') - } - - if $tuskar_ui or $tuskar_ui_ironic_discoverd_url or $tuskar_ui_undercloud_admin_password or $tuskar_ui_deployment_mode { - warning('tuskar module is no longer maintained, all tuskar parameters will be removed after Newton cycle.') - } - # 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. @@ -657,7 +599,7 @@ settings_local.py and parameter server_aliases for setting ServerAlias directive class { '::horizon::wsgi::apache': bind_address => $bind_address, servername => $servername, - server_aliases => $final_server_aliases, + server_aliases => $server_aliases, listen_ssl => $listen_ssl, ssl_redirect => $ssl_redirect, horizon_cert => $horizon_cert, diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 0a87b8c8..abb868c9 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -7,10 +7,6 @@ # [*bind_address*] # (optional) Bind address in Apache for Horizon. (Defaults to '0.0.0.0') # -# [*fqdn*] -# (Optional) Fqdn -# Defaults to undef. -# # [*servername*] # (Optional) Server Name # Defaults to ::fqdn. @@ -93,7 +89,6 @@ # class horizon::wsgi::apache ( $bind_address = undef, - $fqdn = undef, $servername = $::fqdn, $server_aliases = $::fqdn, $listen_ssl = false, @@ -116,14 +111,6 @@ class horizon::wsgi::apache ( ) inherits horizon::params { include ::apache - - if $fqdn { - warning('Parameter fqdn is deprecated. Please use parameter server_aliases for setting ServerAlias directives in vhost.conf.') - $final_server_aliases = $fqdn - } else { - $final_server_aliases = $server_aliases - } - include ::apache::mod::wsgi # We already use apache::vhost to generate our own @@ -220,7 +207,7 @@ class horizon::wsgi::apache ( $default_vhost_conf_no_ip = { servername => $servername, - serveraliases => os_any2array($final_server_aliases), + serveraliases => os_any2array($server_aliases), docroot => '/var/www/', access_log_file => 'horizon_access.log', error_log_file => 'horizon_error.log', diff --git a/releasenotes/notes/rocky-remove-deprecated-params-c788c10d6468657c.yaml b/releasenotes/notes/rocky-remove-deprecated-params-c788c10d6468657c.yaml new file mode 100644 index 00000000..22ac6d1a --- /dev/null +++ b/releasenotes/notes/rocky-remove-deprecated-params-c788c10d6468657c.yaml @@ -0,0 +1,14 @@ +--- +upgrade: + - | + The deprecated horizon::fqdn parameter is now removed. + Please use the allowed_hosts and server_aliases parameters instead. + - | + The deprecated horizon::wsgi::apache::fqdn parameter is now removed. + Please use the server_aliases parameter instead. + - | + The deprecated horizon::custom_theme_path parameter is now removed. + Please use the available_themes parameter instead. + - | + The deprecated tuskar_ui, tuskar_ui_ironic_discoverd_url, tuskar_ui_undercloud_admin_password + and tuskar_ui_deployment_mode is now removed. Please remove the usage of these parameters. diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index 3350ab49..d00c97e8 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -3,8 +3,7 @@ require 'spec_helper' describe 'horizon' do let :params do - { 'secret_key' => 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0', - 'fqdn' => '*' } + { 'secret_key' => 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0' } end let :pre_condition do @@ -57,7 +56,7 @@ describe 'horizon' do "LOGIN_URL = '#{platforms_params[:root_url]}/auth/login/'", "LOGOUT_URL = '#{platforms_params[:root_url]}/auth/logout/'", "LOGIN_REDIRECT_URL = '#{platforms_params[:root_url]}/'", - "ALLOWED_HOSTS = ['*', ]", + "ALLOWED_HOSTS = ['some.host.tld', ]", " 'identity': 3,", 'HORIZON_CONFIG["password_autocomplete"] = "off"', 'HORIZON_CONFIG["images_panel"] = "legacy"', @@ -140,7 +139,7 @@ describe 'horizon' do it 'generates local_settings.py' do verify_concat_fragment_contents(catalogue, 'local_settings.py', [ 'DEBUG = True', - "ALLOWED_HOSTS = ['*', ]", + "ALLOWED_HOSTS = ['some.host.tld', ]", "SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')", 'CSRF_COOKIE_SECURE = True', 'SESSION_COOKIE_SECURE = True', diff --git a/spec/classes/horizon_wsgi_apache_spec.rb b/spec/classes/horizon_wsgi_apache_spec.rb index 83b61f03..26ded568 100644 --- a/spec/classes/horizon_wsgi_apache_spec.rb +++ b/spec/classes/horizon_wsgi_apache_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'horizon::wsgi::apache' do let :params do - { :fqdn => '*', + { :servername => 'some.host.tld', :wsgi_processes => '3', :wsgi_threads => '10', @@ -35,7 +35,7 @@ describe 'horizon::wsgi::apache' do 'access_log_file' => 'horizon_access.log', 'error_log_file' => 'horizon_error.log', 'priority' => '15', - 'serveraliases' => ['*'], + 'serveraliases' => ['some.host.tld'], 'docroot' => '/var/www/', 'ssl' => 'false', 'port' => '80', @@ -72,7 +72,7 @@ describe 'horizon::wsgi::apache' do 'access_log_file' => 'horizon_access.log', 'error_log_file' => 'horizon_error.log', 'priority' => params[:priority], - 'serveraliases' => ['*'], + 'serveraliases' => ['some.host.tld'], 'docroot' => '/var/www/', 'ssl' => 'false', 'port' => '80', @@ -131,7 +131,7 @@ describe 'horizon::wsgi::apache' do 'access_log_file' => 'horizon_ssl_access.log', 'error_log_file' => 'horizon_ssl_error.log', 'priority' => '15', - 'serveraliases' => ['*'], + 'serveraliases' => ['some.host.tld'], 'docroot' => '/var/www/', 'ssl' => 'true', 'port' => '443', @@ -152,7 +152,7 @@ describe 'horizon::wsgi::apache' do 'access_log_file' => 'horizon_access.log', 'error_log_file' => 'horizon_error.log', 'priority' => '15', - 'serveraliases' => ['*'], + 'serveraliases' => ['some.host.tld'], 'docroot' => '/var/www/', 'ssl' => 'false', 'port' => '80', diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb index cb0a4f0e..83efa930 100644 --- a/templates/local_settings.py.erb +++ b/templates/local_settings.py.erb @@ -31,10 +31,10 @@ LOGIN_REDIRECT_URL = '<%= @root_url %>/' # For more information see: # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts #ALLOWED_HOSTS = ['horizon.example.com', ] -<% if @final_allowed_hosts.kind_of?(Array) %> -ALLOWED_HOSTS = ['<%= @final_allowed_hosts.join("', '") %>', ] +<% if @allowed_hosts.kind_of?(Array) %> +ALLOWED_HOSTS = ['<%= @allowed_hosts.join("', '") %>', ] <% else %> -ALLOWED_HOSTS = ['<%= @final_allowed_hosts %>', ] +ALLOWED_HOSTS = ['<%= @allowed_hosts %>', ] <% end %> # Set SSL proxy settings: # Pass this header from the proxy after terminating the SSL, @@ -585,16 +585,6 @@ EXTERNAL_MONITORING = <%= @horizon_app_links %> # 'reverse': False, #} -# CUSTOM_THEME_PATH allows to set to the directory location for the -# theme (e.g., "static/themes/blue"). The path can either be -# relative to the openstack_dashboard directory or an absolute path -# to an accessible location on the file system. -# If not specified, the default CUSTOM_THEME_PATH is -# static/themes/default. -<% if @custom_theme_path %> -CUSTOM_THEME_PATH = '<%= @custom_theme_path %>' -<% end %> - <% if @available_themes.kind_of?(Array) %> AVAILABLE_THEMES = [ <% @available_themes.each do |theme| %>