Repository: ambari Updated Branches: refs/heads/branch-2.5 feb0dda30 -> b2c56544f refs/heads/trunk 9b6bc2158 -> 2c7bd2f49
AMBARI-18445. SmartSense error during host assignment (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2c7bd2f4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2c7bd2f4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2c7bd2f4 Branch: refs/heads/trunk Commit: 2c7bd2f4984e4c08f8154c5a0bf4d2e6fac57c10 Parents: 9b6bc21 Author: Andrew Onishuk <aonis...@hortonworks.com> Authored: Thu Sep 22 16:57:35 2016 +0300 Committer: Andrew Onishuk <aonis...@hortonworks.com> Committed: Thu Sep 22 16:57:35 2016 +0300 ---------------------------------------------------------------------- .../stacks/HDP/2.0.6/services/stack_advisor.py | 7 ++++--- .../python/stacks/2.0.6/common/test_stack_advisor.py | 12 ++++++++---- .../test/python/stacks/2.5/common/test_stack_advisor.py | 5 ++++- 3 files changed, 16 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2c7bd2f4/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py index 800bfa2..6cec585 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py @@ -65,21 +65,22 @@ class HDP206StackAdvisor(DefaultStackAdvisor): if "+" in cardinality: hostsMin = int(cardinality[:-1]) if componentHostsCount < hostsMin: - message = "At least {0} {1} components should be installed in cluster.".format(hostsMin, componentDisplayName) + message = "at least {0} {1} components should be installed in cluster.".format(hostsMin, componentDisplayName) elif "-" in cardinality: nums = cardinality.split("-") hostsMin = int(nums[0]) hostsMax = int(nums[1]) if componentHostsCount > hostsMax or componentHostsCount < hostsMin: - message = "Between {0} and {1} {2} components should be installed in cluster.".format(hostsMin, hostsMax, componentDisplayName) + message = "between {0} and {1} {2} components should be installed in cluster.".format(hostsMin, hostsMax, componentDisplayName) elif "ALL" == cardinality: if componentHostsCount != hostsCount: message = "{0} component should be installed on all hosts in cluster.".format(componentDisplayName) else: if componentHostsCount != int(cardinality): - message = "Exactly {0} {1} components should be installed in cluster.".format(int(cardinality), componentDisplayName) + message = "exactly {0} {1} components should be installed in cluster.".format(int(cardinality), componentDisplayName) if message is not None: + message = "You have selected {0} {1} components. Please consider that {2}".format(componentHostsCount, componentDisplayName, message) items.append({"type": 'host-component', "level": 'ERROR', "message": message, "component-name": componentName}) # Validating host-usage http://git-wip-us.apache.org/repos/asf/ambari/blob/2c7bd2f4/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py index a70922f..cd69dc3 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py @@ -146,7 +146,8 @@ class TestHDP206StackAdvisor(TestCase): result = self.stackAdvisor.validateComponentLayout(services, hosts) expectedItems = [ - {"message": "Ganglia Monitor component should be installed on all hosts in cluster.", "level": "ERROR"} + {"message": "You have selected 1 Ganglia Monitor components. Please consider that Ganglia Monitor component should be installed on all hosts in cluster.", + "level": "ERROR"} ] self.assertValidationResult(expectedItems, result) @@ -165,7 +166,8 @@ class TestHDP206StackAdvisor(TestCase): result = self.stackAdvisor.validateComponentLayout(services, hosts) expectedItems = [ - {"message": "Exactly 2 Ganglia Monitor components should be installed in cluster.", "level": "ERROR"} + {"message": "You have selected 1 Ganglia Monitor components. Please consider that exactly 2 Ganglia Monitor components should be installed in cluster.", + "level": "ERROR"} ] self.assertValidationResult(expectedItems, result) @@ -184,7 +186,8 @@ class TestHDP206StackAdvisor(TestCase): result = self.stackAdvisor.validateComponentLayout(services, hosts) expectedItems = [ - {"message": "At least 3 Ganglia Server components should be installed in cluster.", "level": "ERROR"} + {"message": "You have selected 2 Ganglia Server components. Please consider that at least 3 Ganglia Server components should be installed in cluster.", + "level": "ERROR"} ] self.assertValidationResult(expectedItems, result) @@ -361,7 +364,8 @@ class TestHDP206StackAdvisor(TestCase): result = self.stackAdvisor.validateComponentLayout(services, hosts) expectedItems = [ - {"message": "Between 0 and 1 Ganglia Server components should be installed in cluster.", "level": "ERROR"} + {"message": "You have selected 2 Ganglia Server components. Please consider that between 0 and 1 Ganglia Server components should be installed in cluster.", + "level": "ERROR"} ] self.assertValidationResult(expectedItems, result) http://git-wip-us.apache.org/repos/asf/ambari/blob/2c7bd2f4/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py index 0ed1761..72e59aa 100644 --- a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py @@ -436,7 +436,10 @@ class TestHDP25StackAdvisor(TestCase): services = self.load_json("services-normal-his-2-hosts.json") validations = self.stackAdvisor.getComponentLayoutValidations(services, hosts) - expected = {'component-name': 'HIVE_SERVER_INTERACTIVE', 'message': 'Between 0 and 1 HiveServer2 Interactive components should be installed in cluster.', 'type': 'host-component', 'level': 'ERROR'} + expected = {'component-name': 'HIVE_SERVER_INTERACTIVE', + 'message': 'You have selected 2 HiveServer2 Interactive components. Please consider that between 0 and 1 HiveServer2 Interactive components should be installed in cluster.', + 'type': 'host-component', + 'level': 'ERROR'} self.assertEquals(validations[0], expected)