Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 3048706a9 -> be1b8b5de
  refs/heads/trunk d6b7c20be -> dda165761


http://git-wip-us.apache.org/repos/asf/ambari/blob/dda16576/ambari-server/src/main/resources/stacks/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/stack_advisor.py
index d648a53..cc556c6 100644
--- a/ambari-server/src/main/resources/stacks/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/stack_advisor.py
@@ -1156,7 +1156,7 @@ class DefaultStackAdvisor(StackAdvisor):
     if len(hostsList) != 1:
       scheme = self.getComponentLayoutSchemes().get(componentName, None)
       if scheme is not None:
-        hostIndex = next((index for key, index in scheme.iteritems() if 
isinstance(key, ( int, long )) and len(hostsList) < key), scheme['else'])
+        hostIndex = next((index for key, index in scheme.iteritems() if 
isinstance(key, (int, long)) and len(hostsList) < key), scheme['else'])
       else:
         hostIndex = 0
       for host in hostsList[hostIndex:]:
@@ -1191,16 +1191,16 @@ class DefaultStackAdvisor(StackAdvisor):
     """
     return {}
 
-  """
-  Utility method used for validation warnings.
-  """
   def getWarnItem(self, message):
+    """
+    Utility method used for validation warnings.
+    """
     return {"level": "WARN", "message": message}
 
-  """
-  Utility method used for validation errors.
-  """
   def getErrorItem(self, message):
+    """
+    Utility method used for validation errors.
+    """
     return {"level": "ERROR", "message": message}
 
   def getComponentHostNames(self, servicesDict, serviceName, componentName):
@@ -1403,6 +1403,49 @@ class DefaultStackAdvisor(StackAdvisor):
     hostNamesList = [component["hostnames"] for component in componentsList if 
component["component_name"] == componentName]
     return hostNamesList[0] if len(hostNamesList) > 0 else []
 
+  def getServiceComponents(self, services, serviceName):
+    """
+    Return list of components for serviceName service
+
+    :type services dict
+    :type serviceName str
+    :rtype list
+    """
+    components = []
+
+    if not services or not serviceName:
+      return components
+
+    for service in services["services"]:
+      if service["StackServices"]["service_name"] == serviceName:
+        components.extend(service["components"])
+        break
+
+    return components
+
+  def getHostsForComponent(self, services, serviceName, componentName):
+    """
+    Returns the host(s) on which a requested service's component is hosted.
+
+    :argument services Configuration information for the cluster
+    :argument serviceName Passed-in service in consideration
+    :argument componentName Passed-in component in consideration
+
+    :type services dict
+    :type serviceName str
+    :type componentName str
+    :rtype list
+    """
+    hosts_for_component = []
+    components = self.getServiceComponents(services, serviceName)
+
+    for component in components:
+      if component["StackServiceComponents"]["component_name"] == 
componentName:
+        
hosts_for_component.extend(component["StackServiceComponents"]["hostnames"])
+        break
+
+    return hosts_for_component
+
   def getMountPoints(self, hosts):
     """
     Return list of mounts available on the hosts

http://git-wip-us.apache.org/repos/asf/ambari/blob/dda16576/ambari-web/app/mixins/common/configs/enhanced_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/enhanced_configs.js 
b/ambari-web/app/mixins/common/configs/enhanced_configs.js
index 507dc6a..d1d8f9b 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -321,9 +321,6 @@ App.EnhancedConfigsMixin = 
Em.Mixin.create(App.ConfigWithOverrideRecommendationP
         var changedConfigIds = 
this.get('changedProperties').map(function(changed) {
           return App.config.configId(changed.propertyName, 
changed.propertyFileName);
         });
-        if (this.get('currentlyChangedConfig')) {
-          return 
changedConfigIds.contains(App.config.configId(this.get('currentlyChangedConfig.name'),
 this.get('currentlyChangedConfig.fileName')));
-        }
         return !changedConfigIds.contains(App.config.configId(c.get('name'), 
c.get('filename')));
       }, this).length;
     }, this).length);

Reply via email to