Skip to content

Commit

Permalink
Call the encryption key valid if we don't have a miq_databases entry
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonin committed Mar 13, 2018
1 parent 966f991 commit 268b7ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/tasks/evm_application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@ def self.set_region_file(region_file, new_region)
end

def self.encryption_key_valid?
# if we're a new deployment we won't even be able to get the database row, so just return true
# if we're a new deployment we won't even be able to get the database row
# and if there is no database row, allow this key to be used
return true if deployment_status == "new_deployment"
return true unless (db = MiqDatabase.first)

begin
db = MiqDatabase.first
# both of these should raise if we have the wrong key
db.session_secret_token
db.csrf_secret_token
Expand Down

0 comments on commit 268b7ee

Please sign in to comment.