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

Commit

Permalink
Merge pull request #230 from abel-navarro/timeout
Browse files Browse the repository at this point in the history
Add warning for horizon timeout
  • Loading branch information
dirkmueller committed Oct 18, 2015
2 parents b2b2939 + 26680e4 commit 4bbcf04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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

0 comments on commit 4bbcf04

Please sign in to comment.