[ARVADOS] created: 1.1.3-327-g41e47f3
Git user
git at public.curoverse.com
Thu Apr 5 15:05:06 EDT 2018
at 41e47f3ea2edecd4f15f9f4321de6e71b24aedbc (commit)
commit 41e47f3ea2edecd4f15f9f4321de6e71b24aedbc
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Thu Apr 5 16:04:28 2018 -0300
13105: Set remoteHosts and remoteHostsViaDNS default values when missing.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/apps/workbench/app/assets/javascripts/models/session_db.js b/apps/workbench/app/assets/javascripts/models/session_db.js
index fab8fe3..c09d7c9 100644
--- a/apps/workbench/app/assets/javascripts/models/session_db.js
+++ b/apps/workbench/app/assets/javascripts/models/session_db.js
@@ -95,8 +95,18 @@ window.SessionDB = function() {
var session = db.loadLocal();
var apiHostname = new URL(session.baseURL).hostname;
m.request(session.baseURL+'discovery/v1/apis/arvados/v1/rest').then(function(localDD) {
+ // Just in case we're talking to an old API Server
+ localDD.remoteHosts = localDD.remoteHosts || {};
+ if (localDD.remoteHostsViaDNS === undefined) {
+ localDD.remoteHostsViaDNS = false;
+ }
var uuidPrefix = localDD.uuidPrefix;
m.request(baseURL+'discovery/v1/apis/arvados/v1/rest').then(function(dd) {
+ // Just in case we're talking to an old API Server
+ dd.remoteHosts = dd.remoteHosts || {};
+ if (dd.remoteHostsViaDNS === undefined) {
+ dd.remoteHostsViaDNS = false;
+ }
if (uuidPrefix in dd.remoteHosts ||
(dd.remoteHostsViaDNS && apiHostname.endsWith('.arvadosapi.com'))) {
// Federated identity login via salted token
@@ -285,6 +295,8 @@ window.SessionDB = function() {
var sessions = db.loadAll();
var doc = db.discoveryDoc(db.loadLocal());
doc.map(function(d) {
+ // Just in case we're talking with an old API server.
+ d.remoteHosts = d.remoteHosts || {};
Object.keys(d.remoteHosts).map(function(uuidPrefix) {
if (!(sessions[uuidPrefix])) {
db.findAPI(d.remoteHosts[uuidPrefix]).then(function(baseURL) {
@@ -310,6 +322,11 @@ window.SessionDB = function() {
}
var doc = db.discoveryDoc(session);
doc.map(function(d) {
+ // Just in case we're talking with an old API server.
+ d.remoteHosts = d.remoteHosts || {};
+ if (d.remoteHostsViaDNS === undefined) {
+ d.remoteHostsViaDNS = false;
+ }
// Guess the remote host from the local discovery doc settings
var rHost = null;
if (d.remoteHosts[userUUIDPrefix]) {
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list