ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject ambari git commit: AMBARI-13746. Ranger Plugin Enabling not working in 2.2 because of a stack_advisor error.(vbrodetskyi)
Date Thu, 05 Nov 2015 16:18:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 4f8cb0fa0 -> 8261a8d8c


AMBARI-13746. Ranger Plugin Enabling not working in 2.2 because of a stack_advisor error.(vbrodetskyi)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8261a8d8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8261a8d8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8261a8d8

Branch: refs/heads/branch-2.1
Commit: 8261a8d8c0ff5cbe45a003aeca088338f5f7f080
Parents: 4f8cb0f
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Thu Nov 5 18:17:28 2015 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Thu Nov 5 18:17:28 2015 +0200

----------------------------------------------------------------------
 .../main/resources/stacks/HDP/2.2/services/stack_advisor.py  | 8 +++-----
 .../src/test/python/stacks/2.2/common/test_stack_advisor.py  | 7 ++-----
 2 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8261a8d8/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 8238481..4779543 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
@@ -779,9 +779,8 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
   def recommendStormConfigurations(self, configurations, clusterData, services, hosts):
     putStormSiteProperty = self.putProperty(configurations, "storm-site", services)
     putStormSiteAttributes = self.putPropertyAttribute(configurations, "storm-site")
-    if "core-site" in services["configurations"]:
-      core_site = services["configurations"]["core-site"]["properties"]
-    stackVersion = services["Versions"]["stack_version"]
+    storm_site = getServicesSiteProperties(services, "storm-site")
+    security_enabled = (storm_site is not None and "storm.zookeeper.superACL" in storm_site)
     if "ranger-env" in services["configurations"] and "ranger-storm-plugin-properties" in
services["configurations"] and \
         "ranger-storm-plugin-enabled" in services["configurations"]["ranger-env"]["properties"]:
       putStormRangerPluginProperty = self.putProperty(configurations, "ranger-storm-plugin-properties",
services)
@@ -805,8 +804,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
     else:
       rangerClass = 'org.apache.ranger.authorization.storm.authorizer.RangerStormAuthorizer'
     # Cluster is kerberized
-    if "core-site" in services["configurations"] and \
-          ('hadoop.security.authentication' in core_site and core_site['hadoop.security.authentication']
== 'kerberos'):
+    if security_enabled:
       if rangerPluginEnabled and (rangerPluginEnabled.lower() == 'Yes'.lower()):
         putStormSiteProperty('nimbus.authorizer',rangerClass)
       elif (services["configurations"]["storm-site"]["properties"]["nimbus.authorizer"] ==
rangerClass):

http://git-wip-us.apache.org/repos/asf/ambari/blob/8261a8d8/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 6592489..291a4ea 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
@@ -2518,9 +2518,6 @@ class TestHDP22StackAdvisor(TestCase):
         "stack_version": "2.2"
       },
       "configurations": {
-        "core-site": {
-          "properties": { },
-        },
         "storm-site": {
           "properties": {
             "nimbus.authorizer" : "backtype.storm.security.auth.authorizer.SimpleACLAuthorizer"
@@ -2551,7 +2548,7 @@ class TestHDP22StackAdvisor(TestCase):
     configurations['storm-site']['property_attributes'] = {}
     services['configurations']['storm-site']['properties']['nimbus.authorizer'] = ''
     services['configurations']['ranger-storm-plugin-properties']['properties']['ranger-storm-plugin-enabled']
= 'Yes'
-    services['configurations']['core-site']['properties']['hadoop.security.authentication']
= 'kerberos'
+    services['configurations']['storm-site']['properties']['storm.zookeeper.superACL'] =
'sasl:{{storm_bare_jaas_principal}}'
     self.stackAdvisor.recommendStormConfigurations(configurations, clusterData, services,
None)
     self.assertEquals(configurations['storm-site']['properties']['nimbus.authorizer'], 'com.xasecure.authorization.storm.authorizer.XaSecureStormAuthorizer',
"Test nimbus.authorizer with Ranger Storm plugin enabled in kerberos environment")
 
@@ -2559,7 +2556,7 @@ class TestHDP22StackAdvisor(TestCase):
     configurations['storm-site']['properties'] = {}
     configurations['storm-site']['property_attributes'] = {}
     services['configurations']['ranger-storm-plugin-properties']['properties']['ranger-storm-plugin-enabled']
= 'No'
-    services['configurations']['core-site']['properties']['hadoop.security.authentication']
= 'kerberos'
+    services['configurations']['storm-site']['properties']['storm.zookeeper.superACL'] =
'sasl:{{storm_bare_jaas_principal}}'
     services['configurations']['storm-site']['properties']['nimbus.authorizer'] = 'com.xasecure.authorization.storm.authorizer.XaSecureStormAuthorizer'
     self.stackAdvisor.recommendStormConfigurations(configurations, clusterData, services,
None)
     self.assertEquals(configurations['storm-site']['properties']['nimbus.authorizer'], 'backtype.storm.security.auth.authorizer.SimpleACLAuthorizer',
"Test nimbus.authorizer with Ranger Storm plugin being disabled in kerberos environment")


Mime
View raw message