Przeglądaj źródła

HUE-8591 [cluster] Use name as clusterName throughout the calls

Romain Rigaux 7 lat temu
rodzic
commit
e5fcadc

+ 2 - 2
apps/beeswax/src/beeswax/server/dbms.py

@@ -80,8 +80,8 @@ def get_query_server_config(name='beeswax', server=None, cluster=None):
   LOG.debug("Query cluster: %s" % cluster)
   if cluster and cluster != CLUSTER_ID.get():
     if cluster and 'altus:dataware:k8s' in cluster:
-      name = re.search('cluster:(.+?)/', cluster).group(1)
-      cluster_config = {'server_host': 'impala-coordinator' + name, 'name': cluster}
+      cluster_name = re.search('cluster:(.+?)/', cluster).group(1)
+      cluster_config = {'server_host': 'impala-coordinator' + cluster_name, 'name': cluster}
     else:
       cluster_config = Cluster(user=None).get_config(cluster)
   else:

+ 4 - 1
desktop/libs/notebook/src/notebook/connectors/altus.py

@@ -301,6 +301,7 @@ class DataWarehouse2Api():
   def list_clusters(self):
     clusters = self._root.post('listClusters', contenttype="application/json")
     for cluster in clusters['clusters']:
+      cluster['clusterName'] = cluster['name']
       cluster['workersGroupSize'] = cluster['workerReplicas']
       cluster['instanceType'] = '%(workerCpuCores)s CPU %(workerMemoryInGib)s Memory' % cluster
       cluster['progress'] = '%(workerReplicasOnline)s / %(workerReplicas)s' % cluster
@@ -317,7 +318,9 @@ class DataWarehouse2Api():
 
   def describe_cluster(self, cluster_id):
     data = json.dumps({'clusterName': cluster_id})
-    return self._root.post('describeCluster', data=data, contenttype="application/json")
+    data = self._root.post('describeCluster', data=data, contenttype="application/json")
+    data['cluster']['clusterName'] = data['cluster']['name']
+    return data
 
 
   def update_cluster(self, cluster_name, workers_group_size):