You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/12/09 19:32:42 UTC
ambari git commit: AMBARI-14282. Handle Ranger Admin restart for
downgrade from HDP-2.3 to HDP-2.2 (Gautam Borad via alejandro)
Repository: ambari
Updated Branches:
refs/heads/trunk b31dbf3e6 -> f7a0617dd
AMBARI-14282. Handle Ranger Admin restart for downgrade from HDP-2.3 to HDP-2.2 (Gautam Borad via alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f7a0617d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f7a0617d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f7a0617d
Branch: refs/heads/trunk
Commit: f7a0617ddc4f285139d402cd3b0bd9b8c32dc93a
Parents: b31dbf3
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Wed Dec 9 10:32:32 2015 -0800
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Wed Dec 9 10:32:32 2015 -0800
----------------------------------------------------------------------
.../common-services/RANGER/0.4.0/package/scripts/params.py | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7a0617d/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
index d7c0635..b6e5ee9 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
@@ -23,6 +23,8 @@ from resource_management.libraries.functions.version import format_hdp_stack_ver
from resource_management.libraries.functions.format import format
from resource_management.libraries.functions.default import default
from resource_management.libraries.functions.is_empty import is_empty
+from resource_management.libraries.functions.version import compare_versions
+from resource_management.libraries.functions.constants import Direction
# a map of the Ambari role to the component name
# for use with /usr/hdp/current/<component>
@@ -50,9 +52,16 @@ create_db_dbuser = config['configurations']['ranger-env']['create_db_dbuser']
stack_is_hdp22_or_further = Script.is_hdp_stack_greater_or_equal("2.2")
stack_is_hdp23_or_further = Script.is_hdp_stack_greater_or_equal("2.3")
+downgrade_from_version = default("/commandParams/downgrade_from_version", None)
+upgrade_direction = default("/commandParams/upgrade_direction", None)
+
ranger_conf = '/etc/ranger/admin/conf'
ranger_ugsync_conf = '/etc/ranger/usersync/conf'
+if upgrade_direction == Direction.DOWNGRADE and compare_versions(format_hdp_stack_version(version),'2.3' ) < 0:
+ stack_is_hdp22_or_further = True
+ stack_is_hdp23_or_further = False
+
if stack_is_hdp22_or_further:
ranger_home = '/usr/hdp/current/ranger-admin'
ranger_conf = '/etc/ranger/admin/conf'