Repository: ambari
Updated Branches:
  refs/heads/trunk 5b58d16df -> 08e726ada


AMBARI-5597.  Rename host-groups in cluster create body to host_groups.


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

Branch: refs/heads/trunk
Commit: 08e726ada80c7bb0fc38ffc022568186a0d21241
Parents: 5b58d16
Author: John Speidel <[email protected]>
Authored: Mon Apr 28 13:20:49 2014 -0400
Committer: John Speidel <[email protected]>
Committed: Mon Apr 28 14:33:46 2014 -0400

----------------------------------------------------------------------
 .../server/controller/internal/ClusterResourceProvider.java      | 4 ++--
 ambari-server/src/main/resources/scripts/cluster_blueprint.py    | 2 +-
 .../server/controller/internal/ClusterResourceProviderTest.java  | 2 +-
 .../test/resources/TestAmbaryServer.samples/blueprint_hosts.json | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/08e726ad/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
index 90017ac..2ca70f5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
@@ -248,7 +248,7 @@ public class ClusterResourceProvider extends 
AbstractControllerResourceProvider
 
     // extract to own method
     baseUnsupported.remove("blueprint");
-    baseUnsupported.remove("host-groups");
+    baseUnsupported.remove("host_groups");
 
     return checkConfigPropertyIds(baseUnsupported, "Clusters");
   }
@@ -543,7 +543,7 @@ public class ClusterResourceProvider extends 
AbstractControllerResourceProvider
 
     @SuppressWarnings("unchecked")
     Collection<Map<String, Object>> hostGroups =
-        (Collection<Map<String, Object>>) properties.get("host-groups");
+        (Collection<Map<String, Object>>) properties.get("host_groups");
 
     // iterate over host groups provided in request body
     for (Map<String, Object> hostGroupProperties : hostGroups) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/08e726ad/ambari-server/src/main/resources/scripts/cluster_blueprint.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/scripts/cluster_blueprint.py 
b/ambari-server/src/main/resources/scripts/cluster_blueprint.py
index ce6780e..3ec4a8a 100644
--- a/ambari-server/src/main/resources/scripts/cluster_blueprint.py
+++ b/ambari-server/src/main/resources/scripts/cluster_blueprint.py
@@ -223,7 +223,7 @@ class AmbariBlueprint:
 
   def buildHostAssignments(self, blueprintName, blueprintJson, masters,
                            slaves, gateway = None):
-    hostAssignments = '{{"blueprint":"{0}","host-groups":[{1}]}}'
+    hostAssignments = '{{"blueprint":"{0}","host_groups":[{1}]}}'
     hostGroupHosts = '{{"name":"{0}","hosts":[{1}]}}'
     hosts = '{{"fqdn":"{0}"}},'
     logger.debug("Blueprint: {0}, Masters: {1}, Slaves: 
{2}".format(blueprintName, masters, slaves))

http://git-wip-us.apache.org/repos/asf/ambari/blob/08e726ad/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
index fc08061..32bd72e 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
@@ -241,7 +241,7 @@ public class ClusterResourceProviderTest {
     Map<String, String> hostGroupHostProperties = new HashMap<String, 
String>();
     hostGroupHostProperties.put("fqdn", "host.domain");
     hostGroupHosts.add(hostGroupHostProperties);
-    properties.put("host-groups", hostGroups);
+    properties.put("host_groups", hostGroups);
 
     Map<String, String> mapGroupConfigProperties = new HashMap<String, 
String>();
     mapGroupConfigProperties.put("myGroupProp", "awesomeValue");

http://git-wip-us.apache.org/repos/asf/ambari/blob/08e726ad/ambari-server/src/test/resources/TestAmbaryServer.samples/blueprint_hosts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/resources/TestAmbaryServer.samples/blueprint_hosts.json
 
b/ambari-server/src/test/resources/TestAmbaryServer.samples/blueprint_hosts.json
index 73fd226..5c4ded0 100644
--- 
a/ambari-server/src/test/resources/TestAmbaryServer.samples/blueprint_hosts.json
+++ 
b/ambari-server/src/test/resources/TestAmbaryServer.samples/blueprint_hosts.json
@@ -1 +1 @@
-{"blueprint":"c1","host-groups":[{"name":"master","hosts":[{"fqdn":"host1"}]},{"name":"slaves","hosts":[{"fqdn":"host2"},{"fqdn":"host3"}]}]}
\ No newline at end of file
+{"blueprint":"c1","host_groups":[{"name":"master","hosts":[{"fqdn":"host1"}]},{"name":"slaves","hosts":[{"fqdn":"host2"},{"fqdn":"host3"}]}]}
\ No newline at end of file

Reply via email to