X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4bcecb9f823b4aaab8bd803aa4e90b3d8be9d92a..75556b4f8a694bbb3835ec0387fd6d2c361a561b:/sdk/python/arvados/util.py diff --git a/sdk/python/arvados/util.py b/sdk/python/arvados/util.py index 2380e48b73..be8a03fc31 100644 --- a/sdk/python/arvados/util.py +++ b/sdk/python/arvados/util.py @@ -491,3 +491,11 @@ def get_config_once(svc): if not hasattr(svc, '_cached_config'): svc._cached_config = svc.configs().get().execute() return svc._cached_config + +def get_vocabulary_once(svc): + if not svc._rootDesc.get('resources').get('vocabularies', False): + # Old API server version, no vocabulary export endpoint + return {} + if not hasattr(svc, '_cached_vocabulary'): + svc._cached_vocabulary = svc.vocabularies().get().execute() + return svc._cached_vocabulary