Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 42DF4200BE8 for ; Fri, 23 Dec 2016 17:16:24 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 41A83160B3B; Fri, 23 Dec 2016 16:16:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8F955160B1F for ; Fri, 23 Dec 2016 17:16:23 +0100 (CET) Received: (qmail 26247 invoked by uid 500); 23 Dec 2016 16:16:22 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 26222 invoked by uid 99); 23 Dec 2016 16:16:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Dec 2016 16:16:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 83CD3DFBA3; Fri, 23 Dec 2016 16:16:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dsen@apache.org To: commits@ambari.apache.org Date: Fri, 23 Dec 2016 16:16:22 -0000 Message-Id: <430f3852551e4fcfa58d4e01aaee0d5e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] ambari git commit: AMBARI-19171 Configuring YARN with custom queues leads to misleading errors in Stack Advisor (dgrinenko via dsen) archived-at: Fri, 23 Dec 2016 16:16:24 -0000 Repository: ambari Updated Branches: refs/heads/trunk 2304971d0 -> a934c0315 http://git-wip-us.apache.org/repos/asf/ambari/blob/a934c031/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 8865b70..6b29bc3 100644 --- a/ambari-server/src/main/resources/stacks/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/stack_advisor.py @@ -829,7 +829,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:]: @@ -864,16 +864,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): @@ -1076,6 +1076,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/a934c031/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 f92aac1..071b056 100644 --- a/ambari-web/app/mixins/common/configs/enhanced_configs.js +++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js @@ -316,9 +316,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);