Skip to content

Commit

Permalink
Adding endpoint type parameters
Browse files Browse the repository at this point in the history
Creating openstack_endpoint_type and secondary_endpoint_type.

Change-Id: Ibba15ece974bd668c7d3bdb2b6e427a27fc39965
(cherry picked from commit d88624eb902ad27aef177e197522ac1c395b8c2f)
  • Loading branch information
djschaap authored and fcharlier committed Jan 7, 2014
1 parent 54b6ac7 commit 9090be0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
# [*django_debug*]
# (optional) Enable or disable Django debugging. Defaults to 'False'.
#
# [*openstack_endpoint_type*]
# (optional) endpoint type to use for the endpoints in the Keystone
# service catalog. Defaults to 'undef'.
#
# [*secondary_endpoint_type*]
# (optional) secondary endpoint type to use for the endpoints in the
# Keystone service catalog. Defaults to 'undef'.
#
# [*api_result_limit*]
# (optional) Maximum number of Swift containers/objects to display
# on a single page. Defaults to 1000.
Expand Down Expand Up @@ -79,6 +87,8 @@
$keystone_scheme = 'http',
$keystone_default_role = 'Member',
$django_debug = 'False',
$openstack_endpoint_type = undef,
$secondary_endpoint_type = undef,
$api_result_limit = 1000,
$log_level = 'DEBUG',
$can_set_mount_point = 'True',
Expand Down
28 changes: 28 additions & 0 deletions spec/classes/horizon_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,33 @@
:line => "SSLCertificateKeyFile /etc/ssl/localcerts/apache.key"
)}
end

describe 'with openstack_endpoint_type' do
before do
params.merge!({
:openstack_endpoint_type => 'internalURL',
})
end

it 'generates local_settings.py' do
verify_contents(subject, '/etc/openstack-dashboard/local_settings.py', [
'OPENSTACK_ENDPOINT_TYPE = "internalURL"',
])
end
end

describe 'with secondary_endpoint_type' do
before do
params.merge!({
:secondary_endpoint_type => 'ANY-VALUE',
})
end

it 'generates local_settings.py' do
verify_contents(subject, '/etc/openstack-dashboard/local_settings.py', [
'SECONDARY_ENDPOINT_TYPE = "ANY-VALUE"',
])
end
end
end
end
6 changes: 6 additions & 0 deletions templates/local_settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,19 @@ OPENSTACK_NEUTRON_NETWORK = {
# in the Keystone service catalog. Use this setting when Horizon is running
# external to the OpenStack environment. The default is 'publicURL'.
#OPENSTACK_ENDPOINT_TYPE = "publicURL"
<% if @openstack_endpoint_type %>
OPENSTACK_ENDPOINT_TYPE = "<%= @openstack_endpoint_type %>"
<% end %>

# SECONDARY_ENDPOINT_TYPE specifies the fallback endpoint type to use in the
# case that OPENSTACK_ENDPOINT_TYPE is not present in the endpoints
# in the Keystone service catalog. Use this setting when Horizon is running
# external to the OpenStack environment. The default is None. This
# value should differ from OPENSTACK_ENDPOINT_TYPE if used.
#SECONDARY_ENDPOINT_TYPE = "publicURL"
<% if @secondary_endpoint_type %>
SECONDARY_ENDPOINT_TYPE = "<%= @secondary_endpoint_type %>"
<% end %>

# The number of objects (Swift containers/objects or images) to display
# on a single page before providing a paging element (a "more" link)
Expand Down

0 comments on commit 9090be0

Please sign in to comment.