AMBARI-21650: Ranger Usersync process starts with older stack script during 
cross stack upgrade (mugdha)


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

Branch: refs/heads/branch-feature-logsearch-ui
Commit: a5b8045dfbc7e8c30fc8b0d23d38ef86243c016a
Parents: b487b45
Author: Mugdha Varadkar <mug...@apache.org>
Authored: Thu Aug 3 17:23:33 2017 +0530
Committer: Mugdha Varadkar <mug...@apache.org>
Committed: Fri Aug 4 11:40:15 2017 +0530

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/a5b8045d/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 4bcf9b0..9b1f6e2 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
@@ -551,6 +551,12 @@ def setup_usersync(upgrade_type=None):
     mode = 0755,
   )
 
+  if upgrade_type is not None and params.stack_supports_config_versioning:
+    if os.path.islink('/usr/bin/ranger-usersync'):
+      Link('/usr/bin/ranger-usersync', action="delete")
+
+    Link('/usr/bin/ranger-usersync', to=params.usersync_services_file)
+
   Execute(('ln','-sf', 
format('{usersync_services_file}'),'/usr/bin/ranger-usersync'),
     not_if=format("ls /usr/bin/ranger-usersync"),
     only_if=format("ls {usersync_services_file}"),

Reply via email to