فهرست منبع

AMBARI-3366. Ambari-Client create_cluster and update_configuration doesn't return response. (Andrew Onischuk via mahadev)

Mahadev Konar 11 سال پیش
والد
کامیت
2d946404b9

+ 2 - 3
ambari-client/src/main/python/ambari_client/model/cluster.py

@@ -54,10 +54,9 @@ def _create_cluster(root_resource, cluster_name, version):
   @return: An ClusterModel object
   """
   data = {"Clusters":{"version":str(version)}}
-  cluster = ClusterModel(root_resource, cluster_name, version)
   path = paths.CLUSTERS_PATH + "/%s" % (cluster_name)
-  root_resource.post(path=path , payload=data)
-  return _get_cluster(root_resource, cluster_name)
+  resp = root_resource.post(path=path , payload=data)
+  return utils.ModelUtils.create_model(status.StatusModel, resp, root_resource, "NO_KEY")
 
 
 def _delete_cluster(root_resource, cluster_name):

+ 2 - 2
ambari-client/src/main/python/ambari_client/model/configuration.py

@@ -51,8 +51,8 @@ def _update_configuration(resource_root, cluster_name , type , tag , config_mode
   @return: A ConfigModel object
   """
   data = {"Clusters":{"desired_configs":{ "type":type, "tag":tag, "properties":config_model.properties}}}
-  resource_root.post(path=paths.CREATE_CONFIGURATION_PATH % cluster_name , payload=data)
-  return _get_configuration(resource_root, cluster_name , type , tag="version1")
+  resp = resource_root.post(path=paths.CREATE_CONFIGURATION_PATH % cluster_name , payload=data)
+  return utils.ModelUtils.create_model(status.StatusModel, resp, resource_root, "NO_KEY")
 
 
 def _add_config(root_resource, cluster_name, type, tag , properties):