Skip to content

Commit

Permalink
Add warning for horizon timeout
Browse files Browse the repository at this point in the history
Horizon timeout is impacted by keystone token timeout since when the
token gets outdated, then the user is automatically unable to use
horizon. This patch includes a check for the timeout of horizon and
keystone barclamps.
  • Loading branch information
Vanessa Wallfahrer committed Sep 30, 2015
1 parent 524cae0 commit d2c520d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crowbar_framework/app/models/horizon_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ def validate_proposal_after_save proposal
if keystone["attributes"][ks_svc.bc_name]["api"]["version"].to_f < 3.0
validation_error("Multi domain support requires enabling Keystone V3 API in the keystone proposal first.")
end

horizon_timeout = proposal["attributes"]["nova_dashboard"]["session_timeout"]
keystone_proposal = Proposal.where(barclamp: "keystone", name: "default").first
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("Horizon timeout is bigger than keystone token expiration and these may cause problems.")
end

super
Expand Down
9 changes: 9 additions & 0 deletions crowbar_framework/app/models/keystone_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ def validate_proposal_after_save proposal
validation_error("API version 3 or newer is required when enabling domain specific drivers.")
end

keystone_timeout = proposal["attributes"]["keystone"]["token_expiration"]
horizon_proposal = Proposal.where(barclamp: "nova_dashboard", name: "default").first
horizon_timeout = horizon_proposal["attributes"]["nova_dashboard"]["session_timeout"]

# keystone_timeout is in seconds and horizon_timeout is in minutes
if horizon_timeout * 60 > keystone_timeout
validation_error("Horizon timeout is bigger than keystone token expiration and these may cause problems.")
end

super
end

Expand Down

0 comments on commit d2c520d

Please sign in to comment.