X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6653f96c23ff461bc4cadf5184a95e1c9142f7e6..de11b137d4469e9d54e078ac0dd5664bdb90e486:/services/api/app/models/keep_service.rb diff --git a/services/api/app/models/keep_service.rb b/services/api/app/models/keep_service.rb index 777f6bfb22..f76f5e47a5 100644 --- a/services/api/app/models/keep_service.rb +++ b/services/api/app/models/keep_service.rb @@ -7,6 +7,7 @@ class KeepService < ArvadosModel include KindAndEtag include CommonApiTemplate extend DbCurrentTime + extend CurrentApiClient SERVER_START_TIME = db_current_time @@ -51,11 +52,12 @@ class KeepService < ArvadosModel values = [] id = 1 Rails.configuration.Services.Keepstore.InternalURLs.each do |url, info| - values << "(#{id}, " + quoted_column_values_from_url(url: url.to_s, info: info).join(", ") + ", 'disk', 'f'::bool, #{config_time}, #{config_time}, #{owner}, #{owner}, null)" + values << "(#{id}, " + quoted_column_values_from_url(url: url.to_s, rendezvous: info.Rendezvous).join(", ") + ", 'disk', 'f'::bool, #{config_time}, #{config_time}, #{owner}, #{owner}, null)" id += 1 end - Rails.configuration.Services.Keepproxy.InternalURLs.each do |url, info| - values << "(#{id}, " + quoted_column_values_from_url(url: url.to_s, info: info).join(", ") + ", 'proxy', 'f'::bool, #{config_time}, #{config_time}, #{owner}, #{owner}, null)" + url = Rails.configuration.Services.Keepproxy.ExternalURL.to_s + if !url.blank? + values << "(#{id}, " + quoted_column_values_from_url(url: url, rendezvous: "").join(", ") + ", 'proxy', 'f'::bool, #{config_time}, #{config_time}, #{owner}, #{owner}, null)" id += 1 end if values.length == 0 @@ -69,8 +71,8 @@ class KeepService < ArvadosModel private - def self.quoted_column_values_from_url(url:, info:) - rvz = info.Rendezvous + def self.quoted_column_values_from_url(url:, rendezvous:) + rvz = rendezvous rvz = url if rvz.blank? if /^[a-zA-Z0-9]{15}$/ !~ rvz # If rvz is an URL (either the real service URL, or an alternate