diff --git a/manifests/init.pp b/manifests/init.pp index 5f0a250a..798ab61a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -171,6 +171,10 @@ # header which links to the value of this setting. # Defaults to undef # +# [*compress_enabled*] +# (optional) Boolean to enable compression. +# Defaults to True +# # [*compress_offline*] # (optional) Boolean to enable offline compress of assets. # Defaults to True @@ -588,6 +592,7 @@ class horizon( $ssl_verify_client = undef, $wsgi_processes = $facts['os_workers'], $wsgi_threads = '1', + Boolean $compress_enabled = true, Boolean $compress_offline = true, # TODO(tkajinam) Consider adding more strict validation about key-value Hash $hypervisor_options = {}, diff --git a/releasenotes/notes/compress_enabled-9597ee6f04403fa3.yaml b/releasenotes/notes/compress_enabled-9597ee6f04403fa3.yaml new file mode 100644 index 00000000..058b273e --- /dev/null +++ b/releasenotes/notes/compress_enabled-9597ee6f04403fa3.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``horizon::compress_enabled`` parameter has been added. diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index 7b0f3c69..149de4de 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -56,6 +56,7 @@ describe 'horizon' do " 'handlers': ['file'],", 'SESSION_TIMEOUT = 3600', 'TOKEN_TIMEOUT_MARGIN = 0', + 'COMPRESS_ENABLED = True', 'COMPRESS_OFFLINE = True', "FILE_UPLOAD_TEMP_DIR = '/tmp'", ]) @@ -110,6 +111,7 @@ describe 'horizon' do :api_result_limit => 2000, :api_result_page_size => 40, :dropdown_max_items => 123, + :compress_enabled => false, :compress_offline => false, :hypervisor_options => {'can_set_mount_point' => false, 'can_set_password' => true }, :cinder_options => {'enable_backup' => true }, @@ -215,6 +217,7 @@ describe 'horizon' do " 'handlers': ['console', 'syslog'],", 'SESSION_TIMEOUT = 1800', 'TOKEN_TIMEOUT_MARGIN = 60', + 'COMPRESS_ENABLED = False', 'COMPRESS_OFFLINE = False', "FILE_UPLOAD_TEMP_DIR = '/var/spool/horizon'", 'OVERVIEW_DAYS_RANGE = 1', diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb index c92cd567..fdf191cf 100644 --- a/templates/local_settings.py.erb +++ b/templates/local_settings.py.erb @@ -1044,6 +1044,11 @@ SESSION_TIMEOUT = <%= @session_timeout %> TOKEN_TIMEOUT_MARGIN = <%= @token_timeout_margin %> +# This setting controls whether or not compression is enabled. Disabling +# compression makes Horizon considerably slower, but makes it much easier +# to debug JS and CSS changes +COMPRESS_ENABLED = <%= @compress_enabled.to_s.capitalize %> + # The Ubuntu package includes pre-compressed JS and compiled CSS to allow # offline compression by default. To enable online compression, install # the python-lesscpy package and disable the following option.