ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject ambari git commit: AMBARI-20124. Remove OrderedDict python module code from ranger stack (oleewere)
Date Thu, 23 Feb 2017 09:49:13 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 4c613754c -> c0d94efe3


AMBARI-20124. Remove OrderedDict python module code from ranger stack (oleewere)


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

Branch: refs/heads/branch-2.5
Commit: c0d94efe3e89802fce9e1fa0a9ce947850d7c60a
Parents: 4c61375
Author: oleewere <oleewere@gmail.com>
Authored: Thu Feb 23 10:37:14 2017 +0100
Committer: oleewere <oleewere@gmail.com>
Committed: Thu Feb 23 10:47:08 2017 +0100

----------------------------------------------------------------------
 .../RANGER/0.4.0/package/scripts/setup_ranger_xml.py   | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c0d94efe/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
index 4b08eb7..a8b7f24 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
@@ -19,7 +19,6 @@ limitations under the License.
 """
 import os
 import re
-from collections import OrderedDict
 from resource_management.libraries.script import Script
 from resource_management.libraries.functions.default import default
 from resource_management.core.logger import Logger
@@ -703,8 +702,8 @@ def setup_ranger_audit_solr():
     solr_cloud_util.add_solr_roles(params.config,
                                    roles = [params.infra_solr_role_ranger_admin, params.infra_solr_role_ranger_audit,
params.infra_solr_role_dev],
                                    new_service_principals = [params.ranger_admin_jaas_principal])
-    service_default_principals_map = OrderedDict([('hdfs', 'nn'), ('hbase', 'hbase'), ('hive',
'hive'), ('kafka', 'kafka'), ('kms', 'rangerkms'),
-                                                  ('knox', 'knox'), ('nifi', 'nifi'), ('storm',
'storm'), ('yanr', 'yarn')])
+    service_default_principals_map = [('hdfs', 'nn'), ('hbase', 'hbase'), ('hive', 'hive'),
('kafka', 'kafka'), ('kms', 'rangerkms'),
+                                                  ('knox', 'knox'), ('nifi', 'nifi'), ('storm',
'storm'), ('yanr', 'yarn')]
     service_principals = get_ranger_plugin_principals(service_default_principals_map)
     solr_cloud_util.add_solr_roles(params.config,
                                    roles = [params.infra_solr_role_ranger_audit, params.infra_solr_role_dev],
@@ -749,17 +748,17 @@ def secure_znode(znode, jaasFile):
                                jaas_file=jaasFile,
                                java64_home=params.java_home, sasl_users=[params.ranger_admin_jaas_principal])
 
-def get_ranger_plugin_principals(services_defaults_map):
+def get_ranger_plugin_principals(services_defaults_tuple_list):
   """
   Get ranger plugin user principals from service-default value maps using ranger-*-audit
configurations
   """
   import params
   user_principals = []
-  if len(services_defaults_map) < 1:
+  if len(services_defaults_tuple_list) < 1:
     raise Exception("Services - defaults map parameter is missing.")
 
-  for key, default_value in services_defaults_map.iteritems():
-    user_principal = default(format("configurations/ranger-{key}-audit/xasecure.audit.jaas.Client.option.principal"),
default_value)
+  for (service, default_value) in services_defaults_tuple_list:
+    user_principal = default(format("configurations/ranger-{service}-audit/xasecure.audit.jaas.Client.option.principal"),
default_value)
     user_principals.append(user_principal)
   return user_principals
 


Mime
View raw message