ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gau...@apache.org
Subject ambari git commit: AMBARI-15437. Handle changing symlinks of ranger admin binaries for upgrade scenarios(gautam)
Date Thu, 17 Mar 2016 13:06:22 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 8b150c51f -> 33bc51690


AMBARI-15437. Handle changing symlinks of ranger admin binaries for upgrade scenarios(gautam)


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

Branch: refs/heads/branch-2.2
Commit: 33bc51690ab0022c943408270dfac0502e0f08b6
Parents: 8b150c5
Author: Gautam Borad <gautam@apache.org>
Authored: Thu Mar 17 15:38:48 2016 +0530
Committer: Gautam Borad <gautam@apache.org>
Committed: Thu Mar 17 18:36:14 2016 +0530

----------------------------------------------------------------------
 .../0.4.0/package/scripts/setup_ranger_xml.py   | 24 ++++++++------------
 1 file changed, 10 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/33bc5169/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 6394f51..6fdd931 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
@@ -20,7 +20,7 @@ limitations under the License.
 import os
 import re
 from resource_management.core.logger import Logger
-from resource_management.core.resources.system import File, Directory, Execute
+from resource_management.core.resources.system import File, Directory, Execute, Link
 from resource_management.core.source import DownloadSource, InlineTemplate
 from resource_management.libraries.resources.xml_config import XmlConfig
 from resource_management.libraries.resources.modify_properties_file import ModifyPropertiesFile
@@ -56,9 +56,7 @@ def setup_ranger_admin(upgrade_type=None):
   )
 
   if upgrade_type is not None:
-    ranger_home = format("/usr/hdp/{version}/ranger-admin")
-    ranger_conf = format("/usr/hdp/{version}/ranger-admin/conf")
-    copy_jdbc_connector(stack_version=params.version)
+    copy_jdbc_connector()
 
   File(format("/usr/lib/ambari-agent/{check_db_connection_jar_name}"),
     content = DownloadSource(format("{jdk_location}{check_db_connection_jar_name}")),
@@ -124,6 +122,14 @@ def setup_ranger_admin(upgrade_type=None):
     Execute(('cp', '-f', src_file, dst_file), sudo=True)
     File(params.security_app_context_file, owner=params.unix_user, group=params.unix_group)
 
+  if upgrade_type is not None and params.stack_is_hdp23_or_further:
+
+    if os.path.islink('/usr/bin/ranger-admin'):
+      Link('/usr/bin/ranger-admin', action="delete")
+
+    Link('/usr/bin/ranger-admin',
+    to=format('{ranger_home}/ews/ranger-admin-services.sh'))
+
   Execute(('ln','-sf', format('{ranger_home}/ews/ranger-admin-services.sh'),'/usr/bin/ranger-admin'),
     not_if=format("ls /usr/bin/ranger-admin"),
     only_if=format("ls {ranger_home}/ews/ranger-admin-services.sh"),
@@ -207,11 +213,6 @@ def do_keystore_setup(upgrade_type=None):
   cred_lib_path = params.cred_lib_path
   cred_setup_prefix = params.cred_setup_prefix
 
-  if upgrade_type is not None:
-    ranger_home = format("/usr/hdp/{version}/ranger-admin")
-    cred_lib_path = os.path.join(ranger_home,"cred","lib","*")
-    cred_setup_prefix = (format('{ranger_home}/ranger_credential_helper.py'), '-l', cred_lib_path)
-
   if not is_empty(params.ranger_credential_provider_path):    
     jceks_path = params.ranger_credential_provider_path
     cred_setup = cred_setup_prefix + ('-f', jceks_path, '-k', params.ranger_jpa_jdbc_credential_alias,
'-v', PasswordString(params.ranger_ambari_db_password), '-c', '1')
@@ -317,11 +318,6 @@ def setup_usersync(upgrade_type=None):
   if not is_empty(params.ranger_usersync_ldap_ldapbindpassword) and params.ug_sync_source
== 'org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder':
     password_validation(params.ranger_usersync_ldap_ldapbindpassword)
 
-  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,
     mode=0750,
     owner = params.unix_user,


Mime
View raw message