Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Add warning for horizon timeout #230

Merged
merged 1 commit into from
Oct 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chef/data_bags/crowbar/bc-template-nova_dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"site_theme": "",
"site_branding_link": "",
"help_url": "http://docs.openstack.org/",
"session_timeout": 1440,
"session_timeout": 240,
"db": {
"database": "horizon",
"user": "horizon",
Expand Down
12 changes: 12 additions & 0 deletions crowbar_framework/app/models/nova_dashboard_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ def validate_proposal_after_save proposal
validation_error("Multi domain support requires enabling Keystone V3 API in the keystone proposal first.")
end
end

horizon_timeout = proposal["attributes"]["nova_dashboard"]["session_timeout"]
keystone_proposal = ProposalObject.find_proposal("keystone", "default")
unless keystone_proposal.nil?
keystone_timeout = keystone_proposal["attributes"]["keystone"]["token_expiration"]

# keystone_timeout is in seconds and horizon_timeout is in minutes
if horizon_timeout * 60 > keystone_timeout
validation_error("Setting the Horizon timeout (#{horizon_timeout} minutes) longer than the "\
"Keystone token expiration timeout (#{keystone_timeout / 60} minutes) is not supported.")
end
end

super
end
Expand Down