Added Parameter horizon_upload_mode

Adds a new Puppet parameter "horizon_upload_mode" which goes into
the local_settings.py configuration file and allows to change
the parameter "HORIZON_IMAGES_UPLOAD_MODE"
to one of "legacy", "off" or "direct" (default is "legacy").

Change-Id: I2e36227d318dd74267ad23f14595481b379cbbd6
Closes-Bug: 1738814
This commit is contained in:
Mathias Fechner 2017-12-19 14:56:26 +01:00
parent 01a1e93ef1
commit 04854bf34b
4 changed files with 29 additions and 1 deletions

View File

@ -399,6 +399,12 @@
# Example:
# customization_module => "my_project.overrides"
#
# [*horizon_upload_mode*]
# (optional) Horizon provides the upload mode. The default mode is legacy, off
# will disable the function in Horizon, direct will allow the user agent to directly
# talk to the glance-api.
#
#
# === DEPRECATED group/name
#
# [*fqdn*]
@ -510,6 +516,7 @@ class horizon(
$password_validator_help = undef,
$enable_user_pass = true,
$customization_module = undef,
$horizon_upload_mode = undef,
# DEPRECATED PARAMETERS
$custom_theme_path = undef,
$fqdn = undef,

View File

@ -0,0 +1,6 @@
---
features:
- Add the config option "HORIZON_IMAGES_UPLOAD_MODE".
now it is possible in puppet to configure the option
with "off", "legacy" and "direct".

View File

@ -600,6 +600,19 @@ describe 'horizon' do
])
end
end
context 'with upload mode' do
before do
params.merge!({
:horizon_upload_mode => 'direct',
})
end
it 'sets HORIZON_IMAGES_UPLOAD_MODE in local_settings.py' do
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
'HORIZON_IMAGES_UPLOAD_MODE = direct',
])
end
end
end
shared_examples_for 'horizon on RedHat' do
@ -650,5 +663,4 @@ describe 'horizon' do
it_behaves_like "horizon on #{facts[:osfamily]}"
end
end
end

View File

@ -1029,3 +1029,6 @@ REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES',
HORIZON_CONFIG["disallow_iframe_embed"] = True
<% end %>
<% if @horizon_upload_mode %>
HORIZON_IMAGES_UPLOAD_MODE = <%= @horizon_upload_mode %>
<% end %>