Skip to content

Commit

Permalink
Save Aws Region in File Depot for DB Backup
Browse files Browse the repository at this point in the history
The AWS region for S3 file depots was not being saved when passed in from the UI.
  • Loading branch information
jerryk55 committed Aug 6, 2018
1 parent ae59274 commit 769ad21
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/models/miq_schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,11 @@ def validate_file_depot # TODO: Do we need this if the validations are on the F
end

def verify_file_depot(params) # TODO: This logic belongs in the UI, not sure where
depot_class = FileDepot.supported_protocols[params[:uri_prefix]]
depot = file_depot.class.name == depot_class ? file_depot : build_file_depot(:type => depot_class)
depot.name = params[:name]
depot.uri = params[:uri]
depot_class = FileDepot.supported_protocols[params[:uri_prefix]]
depot = file_depot.class.name == depot_class ? file_depot : build_file_depot(:type => depot_class)
depot.name = params[:name]
depot.uri = params[:uri]
depot.aws_region = params[:aws_region]
if params[:save]
file_depot.save!
file_depot.update_authentication(:default => {:userid => params[:username], :password => params[:password]}) if (params[:username] || params[:password]) && depot.class.requires_credentials?
Expand Down

0 comments on commit 769ad21

Please sign in to comment.