Skip to content

Commit

Permalink
Merge pull request #11990 from carbonin/fix_central_admin_authenticat…
Browse files Browse the repository at this point in the history
…ion_ui

Add the provider region to the replication subscription array data
  • Loading branch information
chessbyte committed Oct 18, 2016
2 parents 62ce0da + ee0f8f5 commit 3e90d92
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions app/controllers/ops_controller/settings/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ def pglogical_subscriptions_form_fields
subscriptions = get_subscriptions_array(subscriptions) unless subscriptions.empty?
if replication_type == :global
subscriptions.each do |h|
region = MiqRegion.find_by( :region => h['provider_region'])
remote_ws_address = region ? region.remote_ws_address : ''
h.merge!(:auth_key_configured => !!(region && region.auth_key_configured?), :remote_ws_address => remote_ws_address)
region = MiqRegion.find_by(:region => h[:provider_region])
h.merge!(
:auth_key_configured => !!region.try(:auth_key_configured?),
:remote_ws_address => region.try(:remote_ws_address).to_s
)
end
end

Expand Down Expand Up @@ -296,15 +298,17 @@ def params_for_connection_validation(subscription_params)
end

def get_subscriptions_array(subscriptions)
subscriptions.collect { |sub|
{:dbname => sub.dbname,
:host => sub.host,
:id => sub.id,
:user => sub.user,
:password => '●●●●●●●●',
:port => sub.port
subscriptions.collect do |sub|
{
:dbname => sub.dbname,
:host => sub.host,
:id => sub.id,
:user => sub.user,
:password => '●●●●●●●●',
:port => sub.port,
:provider_region => sub.provider_region
}
}
end
end

def valid_replication_type
Expand Down

0 comments on commit 3e90d92

Please sign in to comment.