Skip to content

Commit

Permalink
Ensure #validate_encryption_key! returns true when successful
Browse files Browse the repository at this point in the history
Before this, #validate_encryption_key! would return nil when successful
because of the way the conditional was written, now if the rake task
succeeds, we will return true.

Introduced in ManageIQ#34
  • Loading branch information
carbonin committed Aug 16, 2018
1 parent 4ad363e commit daff728
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/manageiq/appliance_console/database_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def self.load_current

def validate_encryption_key!
raise "Encryption key invalid" unless ManageIQ::ApplianceConsole::Utilities.rake("evm:validate_encryption_key", {})
true
end

def do_save(settings)
Expand Down
2 changes: 1 addition & 1 deletion spec/database_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def say(*_args)
it "normal case" do
allow(@config).to receive_messages(:validated => true)
expect(@config).to receive(:create_or_join_region).and_return(true)
expect(@config).to receive(:validate_encryption_key!).and_return(true)
expect(ManageIQ::ApplianceConsole::Utilities).to receive(:rake).with("evm:validate_encryption_key", {}).and_return(true)

allow(@config).to receive_messages(:merged_settings => @settings)
expect(@config).to receive(:do_save).with(@settings)
Expand Down

0 comments on commit daff728

Please sign in to comment.