From 4da543b4b56cee62fe90207fda59890327fa53a9 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Tue, 9 Aug 2016 10:07:14 -0400 Subject: [PATCH] Add images_panel parameter default to HORIZON_CONFIG Review https://review.openstack.org/#/c/339122/ adds parameter images_panel to HORIZON_CONFIG dict. It requires a default value to work properly. This patch add parameter images_panel to set the enabled panel to legacy (default value) or angular. Change-Id: I50ca03492464f9fb2f84963352b2e65c14d44953 --- manifests/init.pp | 7 +++++++ .../notes/add-images-panel-parameter-cb010871c8e1d0d1.yaml | 6 ++++++ spec/classes/horizon_init_spec.rb | 3 +++ templates/local_settings.py.erb | 4 ++++ 4 files changed, 20 insertions(+) create mode 100644 releasenotes/notes/add-images-panel-parameter-cb010871c8e1d0d1.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 29b90223..df96a543 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -271,6 +271,11 @@ # Valid values are 'on' and 'off' # Defaults to 'off' # +# [*images_panel*] +# (optional) Enabled panel for images. +# Valid values are 'legacy' and 'angular' +# Defaults to 'legacy' +# # === DEPRECATED group/name # # [*fqdn*] @@ -365,6 +370,7 @@ class horizon( $available_themes = false, $default_theme = false, $password_autocomplete = 'off', + $images_panel = 'legacy', # DEPRECATED PARAMETERS $custom_theme_path = undef, $fqdn = undef, @@ -437,6 +443,7 @@ class horizon( $neutron_options_real = merge($neutron_defaults,$neutron_options) validate_hash($api_versions) validate_re($password_autocomplete, ['^on$', '^off$']) + validate_re($images_panel, ['^legacy$', '^angular$']) if $cache_backend =~ /MemcachedCache/ { ensure_packages('python-memcache', diff --git a/releasenotes/notes/add-images-panel-parameter-cb010871c8e1d0d1.yaml b/releasenotes/notes/add-images-panel-parameter-cb010871c8e1d0d1.yaml new file mode 100644 index 00000000..9f6c40ca --- /dev/null +++ b/releasenotes/notes/add-images-panel-parameter-cb010871c8e1d0d1.yaml @@ -0,0 +1,6 @@ +--- +features: + - A new panel for glance images based on angularjs + has been created in horizon. New parameter images_panel + has been added to puppet-horizon to configure + the enabled panel for images, legacy or angular. diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index f29216f5..bfdabc8f 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -60,6 +60,7 @@ describe 'horizon' do "ALLOWED_HOSTS = ['*', ]", " 'identity': 3,", 'HORIZON_CONFIG["password_autocomplete"] = "off"', + 'HORIZON_CONFIG["images_panel"] = "legacy"', "SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'", 'OPENSTACK_KEYSTONE_URL = "http://127.0.0.1:5000"', 'OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"', @@ -125,6 +126,7 @@ describe 'horizon' do ], :default_theme => 'default', :password_autocomplete => 'on', + :images_panel => 'angular', }) end @@ -138,6 +140,7 @@ describe 'horizon' do "OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True", "OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'domain.tld'", 'HORIZON_CONFIG["password_autocomplete"] = "on"', + 'HORIZON_CONFIG["images_panel"] = "angular"', "SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'", " 'DEAD_RETRY': 1,", " 'SERVER_RETRIES': 1,", diff --git a/templates/local_settings.py.erb b/templates/local_settings.py.erb index 5ef76a9b..25f44a75 100644 --- a/templates/local_settings.py.erb +++ b/templates/local_settings.py.erb @@ -137,6 +137,10 @@ HORIZON_CONFIG["password_autocomplete"] = "<%= @password_autocomplete %>" # including on the login form. #HORIZON_CONFIG["disable_password_reveal"] = False +# Configure enabled image panel. It can be legacy or angular. +#HORIZON_CONFIG["images_panel"] = "legacy" +HORIZON_CONFIG["images_panel"] = "<%= @images_panel %>" + LOCAL_PATH = os.path.dirname(os.path.abspath(__file__)) # Set custom secret key: