[core] API should not check for remote cloud clusters if they are not configured
@@ -138,6 +138,7 @@ def get_context_computes(request, interface):
computes = []
clusters = get_clusters(request.user).values()
+ has_altus_clusters = [cluster for cluster in clusters if 'altus' in cluster['type']]
if interface == 'hive' or interface == 'impala' or interface == 'oozie' or interface == 'report':
computes.extend([{
@@ -149,13 +150,13 @@ def get_context_computes(request, interface):
} for cluster in clusters if cluster.get('type') == 'direct' and cluster['interface'] in (interface, 'all')
])
+ if has_altus_clusters:
if interface == 'impala' or interface == 'report':
if IS_K8S_ONLY.get():
dw_clusters = DataWarehouse2Api(request.user).list_clusters()['clusters']
else:
dw_clusters = AnalyticDbApi(request.user).list_clusters()['clusters']
- if [cluster for cluster in clusters if 'altus' in cluster['type']]:
computes.extend([{
'id': cluster.get('crn'),
'name': cluster.get('clusterName'),
@@ -167,7 +168,6 @@ def get_context_computes(request, interface):
)
if interface == 'oozie' or interface == 'spark2':
- if [cluster for cluster in clusters if 'altus' in cluster['type']]:
computes.extend([{
'id': cluster.get('crn'),
'name': cluster.get('clusterName'),
