Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-14714-blueprintv2 b3ae38154 -> 92fe9a13a
AMBARI-22253. Fix regression caused by AMBARI-22604 during cluster creation (adoroszlai) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/92fe9a13 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/92fe9a13 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/92fe9a13 Branch: refs/heads/branch-feature-AMBARI-14714-blueprintv2 Commit: 92fe9a13ae149dc30ea382f26bceda8fdeff6037 Parents: b3ae381 Author: Doroszlai, Attila <[email protected]> Authored: Sat Dec 9 11:36:48 2017 +0100 Committer: Doroszlai, Attila <[email protected]> Committed: Sat Dec 9 11:36:48 2017 +0100 ---------------------------------------------------------------------- .../AmbariManagementControllerImpl.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/92fe9a13/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index b22fa61..79dda05 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -900,13 +900,11 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle // If the config type is for a service, then allow a user with SERVICE_MODIFY_CONFIGS to // update, else ensure the user has CLUSTER_MODIFY_CONFIGS - Long service = null; - + Service service = null; try { - service = cluster.getServiceForConfigTypes(Collections.singleton(configType)); - } catch (IllegalArgumentException e) { - // Ignore this since we may have hit a config type that spans multiple services. This may - // happen in unit test cases but should not happen with later versions of stacks. + service = cluster.getServiceByConfigType(configType); + } catch (IndexOutOfBoundsException e) { + // may happen for cluster-wide config types } // Get the changes so that the user's intention can be determined. For example, maybe @@ -1014,13 +1012,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle StackId stackId = null; if (null != service) { - try { - Service svc = cluster.getService(service); - stackId = svc.getDesiredStackId(); - } catch (AmbariException ambariException) { - LOG.warn("Adding configurations for {} even though its parent service {} is not installed", - configType, service); - } + stackId = service.getDesiredStackId(); } if (null == stackId) {
