Merge branch '16265-security-updates' into dependabot/bundler/apps/workbench/nokogiri...
[arvados.git] / sdk / python / arvados / util.py
index fd29a3dc1d46938d2ea9e5c661bea2cbf20659be..dcc0417c138484b9d3f589ea19f75dacf4be6122 100644 (file)
@@ -419,3 +419,11 @@ def new_request_id():
             rid += chr(c+ord('a')-10)
         n = n // 36
     return rid
+
+def get_config_once(svc):
+    if not svc._rootDesc.get('resources').get('configs', False):
+        # Old API server version, no config export endpoint
+        return {}
+    if not hasattr(svc, '_cached_config'):
+        svc._cached_config = svc.configs().get().execute()
+    return svc._cached_config