[ARVADOS] updated: a55ba6e070b749209c1baa4a45c681bc3022d735

Git user git at public.curoverse.com
Mon Jul 25 16:41:30 EDT 2016


Summary of changes:
 sdk/go/arvadosclient/arvadosclient.go | 12 ++++++++++--
 sdk/go/keepclient/discover.go         |  1 -
 sdk/go/keepclient/discover_test.go    |  2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

       via  a55ba6e070b749209c1baa4a45c681bc3022d735 (commit)
       via  fdca402f078e0923326c745f604c5b05b73f455a (commit)
      from  2ddfe9df5ddeb99bb3856ce166108f5a28f2d360 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit a55ba6e070b749209c1baa4a45c681bc3022d735
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Jul 25 16:41:25 2016 -0400

    9550: Ignore extra spaces in ARVADOS_KEEP_SERVICES, and ensure each entry is an absolute URI.

diff --git a/sdk/go/arvadosclient/arvadosclient.go b/sdk/go/arvadosclient/arvadosclient.go
index 57f81c2..aeb81f9 100644
--- a/sdk/go/arvadosclient/arvadosclient.go
+++ b/sdk/go/arvadosclient/arvadosclient.go
@@ -120,8 +120,16 @@ func MakeArvadosClient() (ac ArvadosClient, err error) {
 		External: external,
 		Retries:  2}
 
-	if s := os.Getenv("ARVADOS_KEEP_SERVICES"); s != "" {
-		ac.KeepServiceURIs = strings.Split(s, " ")
+	for _, s := range strings.Split(os.Getenv("ARVADOS_KEEP_SERVICES"), " ") {
+		if s == "" {
+			continue
+		}
+		if u, err := url.Parse(s); err != nil {
+			return ac, fmt.Errorf("ARVADOS_KEEP_SERVICES: %q: %s", s, err)
+		} else if !u.IsAbs() {
+			return ac, fmt.Errorf("ARVADOS_KEEP_SERVICES: %q: not an absolute URI", s)
+		}
+		ac.KeepServiceURIs = append(ac.KeepServiceURIs, s)
 	}
 
 	if ac.ApiServer == "" {
diff --git a/sdk/go/keepclient/discover_test.go b/sdk/go/keepclient/discover_test.go
index b145ee6..ee31ea0 100644
--- a/sdk/go/keepclient/discover_test.go
+++ b/sdk/go/keepclient/discover_test.go
@@ -42,7 +42,7 @@ func (s *ServerRequiredSuite) TestOverrideDiscovery(c *check.C) {
 	c.Assert(err, check.IsNil)
 	arv1.ApiToken = arvadostest.ActiveToken
 
-	os.Setenv("ARVADOS_KEEP_SERVICES", ks[0].url+" "+ks[1].url)
+	os.Setenv("ARVADOS_KEEP_SERVICES", ks[0].url+"  "+ks[1].url+" ")
 	arv2, err := arvadosclient.MakeArvadosClient()
 	c.Assert(err, check.IsNil)
 	arv2.ApiToken = arvadostest.ActiveToken

commit fdca402f078e0923326c745f604c5b05b73f455a
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Jul 25 16:20:02 2016 -0400

    9550: Remove debug printf

diff --git a/sdk/go/keepclient/discover.go b/sdk/go/keepclient/discover.go
index 95a73bb..2892031 100644
--- a/sdk/go/keepclient/discover.go
+++ b/sdk/go/keepclient/discover.go
@@ -27,7 +27,6 @@ func (this *KeepClient) DiscoverKeepServers() error {
 		for i, uri := range this.Arvados.KeepServiceURIs {
 			roots[fmt.Sprintf("00000-bi6l4-%015d", i)] = uri
 		}
-		log.Printf("%+v", roots)
 		this.SetServiceRoots(roots, roots, roots)
 		return nil
 	}

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list