Repository: ambari Updated Branches: refs/heads/trunk e26e8ee5e -> c9b6c7874
AMBARI-11261. Stack advisor should handle when 'ranger-hive-plugin-properties' not provided (srimanth) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c9b6c787 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c9b6c787 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c9b6c787 Branch: refs/heads/trunk Commit: c9b6c7874ea04c58cce39833f1740c4456f5c9d4 Parents: e26e8ee Author: Srimanth Gunturi <[email protected]> Authored: Tue May 19 18:25:30 2015 -0700 Committer: Srimanth Gunturi <[email protected]> Committed: Tue May 19 21:01:07 2015 -0700 ---------------------------------------------------------------------- .../stacks/HDP/2.2/services/stack_advisor.py | 8 ++++---- .../stacks/2.2/common/test_stack_advisor.py | 21 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c9b6c787/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py index 4366def..224c0b2 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py @@ -661,7 +661,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor): #Adding Ranger Plugin logic here ranger_plugin_properties = getSiteProperties(configurations, "ranger-hdfs-plugin-properties") - ranger_plugin_enabled = ranger_plugin_properties['ranger-hdfs-plugin-enabled'] + ranger_plugin_enabled = ranger_plugin_properties['ranger-hdfs-plugin-enabled'] if ranger_plugin_properties else 'No' servicesList = [service["StackServices"]["service_name"] for service in services["services"]] if ("RANGER" in servicesList) and (ranger_plugin_enabled.lower() == 'Yes'.lower()): if hdfs_site['dfs.permissions.enabled'] != 'true': @@ -761,7 +761,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor): validationItems = [] #Adding Ranger Plugin logic here ranger_plugin_properties = getSiteProperties(configurations, "ranger-hive-plugin-properties") - ranger_plugin_enabled = ranger_plugin_properties['ranger-hive-plugin-enabled'] + ranger_plugin_enabled = ranger_plugin_properties['ranger-hive-plugin-enabled'] if ranger_plugin_properties else 'No' servicesList = [service["StackServices"]["service_name"] for service in services["services"]] ##Add stack validations only if Ranger is enabled. if ("RANGER" in servicesList): @@ -817,7 +817,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor): validationItems = [] #Adding Ranger Plugin logic here ranger_plugin_properties = getSiteProperties(configurations, "ranger-hive-plugin-properties") - ranger_plugin_enabled = ranger_plugin_properties['ranger-hive-plugin-enabled'] + ranger_plugin_enabled = ranger_plugin_properties['ranger-hive-plugin-enabled'] if ranger_plugin_properties else 'No' servicesList = [service["StackServices"]["service_name"] for service in services["services"]] ##Add stack validations only if Ranger is enabled. if ("RANGER" in servicesList): @@ -877,7 +877,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor): #Adding Ranger Plugin logic here ranger_plugin_properties = getSiteProperties(configurations, "ranger-hbase-plugin-properties") - ranger_plugin_enabled = ranger_plugin_properties['ranger-hbase-plugin-enabled'] + ranger_plugin_enabled = ranger_plugin_properties['ranger-hbase-plugin-enabled'] if ranger_plugin_properties else 'No' prop_name = 'hbase.security.authorization' prop_val = "true" servicesList = [service["StackServices"]["service_name"] for service in services["services"]] http://git-wip-us.apache.org/repos/asf/ambari/blob/c9b6c787/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py index 4abae12..5b6d7b1 100644 --- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py @@ -2301,6 +2301,27 @@ class TestHDP22StackAdvisor(TestCase): pass + def test_validateHiveConfigurations(self): + properties = {"hive_security_authorization": "None", "hive.exec.orc.default.stripe.size": "8388608"} + configurations = { + "hive-site": { + "properties": {"hive.security.authorization.enabled": "true"} + }, + "hive-env": { + "properties": {"hive_security_authorization": "None"} + } + } + services = { + "services": [] + } + + # Test for 'ranger-hive-plugin-properties' not being in configs + res_expected = [] + res = self.stackAdvisor.validateHiveConfigurations(properties, {}, configurations, services, {}) + self.assertEquals(res, res_expected) + + pass + def test_recommendYarnCGroupConfigurations(self): servicesList = ["YARN"] configurations = {}
