[ARVADOS] updated: 7d2ce5fa717f587963f64e466a9c3dd33faef27b
git at public.curoverse.com
git at public.curoverse.com
Wed May 21 13:30:37 EDT 2014
Summary of changes:
sdk/python/arvados/errors.py | 2 ++
sdk/python/arvados/keep.py | 17 ++++++++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
via 7d2ce5fa717f587963f64e466a9c3dd33faef27b (commit)
from 548f183c23606b9febcadbbfd658aa921c3baaf5 (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 7d2ce5fa717f587963f64e466a9c3dd33faef27b
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed May 21 13:30:28 2014 -0400
2751: Added support for keep_services table, can still use keep_disks as a fallback.
diff --git a/sdk/python/arvados/errors.py b/sdk/python/arvados/errors.py
index e4c69a3..b4afb21 100644
--- a/sdk/python/arvados/errors.py
+++ b/sdk/python/arvados/errors.py
@@ -14,3 +14,5 @@ class KeepWriteError(Exception):
pass
class NotImplementedError(Exception):
pass
+class NoKeepServersError(Exception):
+ pass
diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index c506997..8cf9a65 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -177,16 +177,23 @@ class KeepClient(object):
self.using_proxy = True
else:
try:
- keep_disks = arvados.api().keep_disks().list().execute()['items']
+ try:
+ keep_services = arvados.api().keep_services().accessible().execute()['items']
+ except:
+ keep_services = arvados.api().keep_disks().list().execute()['items']
+
+ if len(keep_services) == 0:
+ raise arvados.errors.NoKeepServersError()
+
+ if 'service_type' in keep_services[0] and keep_services[0]['service_type'] == 'proxy':
+ self.using_proxy = True
+
roots = (("http%s://%s:%d/" %
('s' if f['service_ssl_flag'] else '',
f['service_host'],
f['service_port']))
- for f in keep_disks)
+ for f in keep_services)
self.service_roots = sorted(set(roots))
- if len(keep_disks) == 1 and re.match(r'[a-z0-9]{5}-penuu-keepproxy......', keep_disks[0]['uuid']):
- # Proxies have a special UUID pattern.
- self.using_proxy = True
logging.debug(str(self.service_roots))
finally:
self.lock.release()
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list