16221: Fix test for config endpoint.
authorTom Clegg <tom@tomclegg.ca>
Thu, 12 Mar 2020 04:15:16 +0000 (00:15 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Mon, 13 Apr 2020 15:16:43 +0000 (11:16 -0400)
x['configs'] raises KeyError on an old discovery doc -- test
x.get('configs', False) instead.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

sdk/python/arvados/util.py

index 9e0a3178305068c4edec716c57467221f98af562..dcc0417c138484b9d3f589ea19f75dacf4be6122 100644 (file)
@@ -421,7 +421,7 @@ def new_request_id():
     return rid
 
 def get_config_once(svc):
-    if not svc._rootDesc.get('resources')['configs']:
+    if not svc._rootDesc.get('resources').get('configs', False):
         # Old API server version, no config export endpoint
         return {}
     if not hasattr(svc, '_cached_config'):