Merge branch 'master' into 4426-search-documentation
[arvados.git] / sdk / go / keepclient / support.go
index c24849e687a8d11cf2e5d2154fdd62d0e470ec83..940a110081dbaa46920cb472ea09d9e0635fd219 100644 (file)
@@ -11,7 +11,6 @@ import (
        "log"
        "net"
        "net/http"
-       "os"
        "strings"
        "time"
 )
@@ -77,15 +76,7 @@ func (this *KeepClient) setClientSettingsStore() {
        }
 }
 
-func (this *KeepClient) DiscoverKeepServers() error {
-       if prx := os.Getenv("ARVADOS_KEEP_PROXY"); prx != "" {
-               sr := map[string]string{"proxy": prx}
-               this.SetServiceRoots(sr)
-               this.Using_proxy = true
-               this.setClientSettingsProxy()
-               return nil
-       }
-
+func (this *KeepClient) DiscoverKeepServers() (map[string]string, error) {
        type svcList struct {
                Items []keepDisk `json:"items"`
        }
@@ -95,7 +86,7 @@ func (this *KeepClient) DiscoverKeepServers() error {
 
        if err != nil {
                if err := this.Arvados.List("keep_disks", nil, &m); err != nil {
-                       return err
+                       return nil, err
                }
        }
 
@@ -130,7 +121,7 @@ func (this *KeepClient) DiscoverKeepServers() error {
 
        this.SetServiceRoots(service_roots)
 
-       return nil
+       return service_roots, nil
 }
 
 type uploadStatus struct {