You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2015/11/13 18:23:16 UTC

ambari git commit: AMBARI-13273 Ambari stack changes to allow Ranger Usersync to be installed on separate host. (2nd patch) (gautam via jaimin)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 b3c8d1e05 -> 5e34244f8


AMBARI-13273 Ambari stack changes to allow Ranger Usersync to be installed on separate host. (2nd patch) (gautam via jaimin)


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

Branch: refs/heads/branch-2.1
Commit: 5e34244f84f63b408b475856da332ae8df972261
Parents: b3c8d1e
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Fri Nov 13 09:21:20 2015 -0800
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Fri Nov 13 09:23:12 2015 -0800

----------------------------------------------------------------------
 .../RANGER/0.4.0/package/scripts/setup_ranger_xml.py         | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5e34244f/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 611fde7..39fad24 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
@@ -284,6 +284,7 @@ def setup_usersync(upgrade_type=None):
   import params
 
   usersync_home = params.usersync_home
+  ranger_home = params.ranger_home
   ranger_ugsync_conf = params.ranger_ugsync_conf
 
   if not is_empty(params.ranger_usersync_ldap_ldapbindpassword) and params.ug_sync_source == 'org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder':
@@ -291,6 +292,7 @@ def setup_usersync(upgrade_type=None):
 
   if upgrade_type is not None:
     usersync_home = format("/usr/hdp/{version}/ranger-usersync")
+    ranger_home = format("/usr/hdp/{version}/ranger-admin")
     ranger_ugsync_conf = format("/usr/hdp/{version}/ranger-usersync/conf")
 
   Directory(params.ranger_pid_dir,
@@ -334,8 +336,12 @@ def setup_usersync(upgrade_type=None):
   if os.path.isfile(params.cred_validator_file):
     File(params.cred_validator_file, group=params.unix_group, mode=04555)
 
+  cred_file = format('{ranger_home}/ranger_credential_helper.py')
+  if os.path.isfile(format('{usersync_home}/ranger_credential_helper.py')):
+    cred_file = format('{usersync_home}/ranger_credential_helper.py')
+
   cred_lib = os.path.join(usersync_home,"lib","*")
-  cred_setup_prefix = (format('{usersync_home}/ranger_credential_helper.py'), '-l', cred_lib)
+  cred_setup_prefix = (cred_file, '-l', cred_lib)
 
   cred_setup = cred_setup_prefix + ('-f', params.ugsync_jceks_path, '-k', 'usersync.ssl.key.password', '-v', PasswordString(params.ranger_usersync_keystore_password), '-c', '1')
   Execute(cred_setup, environment={'JAVA_HOME': params.java_home}, logoutput=True, sudo=True)