You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2013/10/04 07:28:16 UTC

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

Updated Branches:
  refs/heads/trunk 0c42fd853 -> 2d946404b


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


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/2d946404
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/2d946404
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/2d946404

Branch: refs/heads/trunk
Commit: 2d946404b9a0f58f2438a2f549aa577b125d7d92
Parents: 0c42fd8
Author: Mahadev Konar <ma...@apache.org>
Authored: Thu Oct 3 22:28:57 2013 -0700
Committer: Mahadev Konar <ma...@apache.org>
Committed: Thu Oct 3 22:28:57 2013 -0700

----------------------------------------------------------------------
 ambari-client/src/main/python/ambari_client/model/cluster.py    | 5 ++---
 .../src/main/python/ambari_client/model/configuration.py        | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2d946404/ambari-client/src/main/python/ambari_client/model/cluster.py
----------------------------------------------------------------------
diff --git a/ambari-client/src/main/python/ambari_client/model/cluster.py b/ambari-client/src/main/python/ambari_client/model/cluster.py
index 75ac0c9..f765f2b 100755
--- a/ambari-client/src/main/python/ambari_client/model/cluster.py
+++ b/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):

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/2d946404/ambari-client/src/main/python/ambari_client/model/configuration.py
----------------------------------------------------------------------
diff --git a/ambari-client/src/main/python/ambari_client/model/configuration.py b/ambari-client/src/main/python/ambari_client/model/configuration.py
index fcdcca1..6cd2c2a 100755
--- a/ambari-client/src/main/python/ambari_client/model/configuration.py
+++ b/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):