From 769ad21bcdde15bdb75d81688cb862791a2622ed Mon Sep 17 00:00:00 2001 From: Jerry Keselman Date: Mon, 6 Aug 2018 10:36:27 -0400 Subject: [PATCH] Save Aws Region in File Depot for DB Backup The AWS region for S3 file depots was not being saved when passed in from the UI. --- app/models/miq_schedule.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/miq_schedule.rb b/app/models/miq_schedule.rb index 3c3cc36f944..9324d64a014 100644 --- a/app/models/miq_schedule.rb +++ b/app/models/miq_schedule.rb @@ -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?