Skip to content

Commit

Permalink
Merge pull request #17803 from jerryk55/s3_file_depot_save_aws_region
Browse files Browse the repository at this point in the history
Save Aws Region in File Depot for DB Backup
  • Loading branch information
carbonin authored Aug 6, 2018
2 parents f57d63f + 769ad21 commit 7b517b5
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 7b517b5

Please sign in to comment.