Repository: ambari
Updated Branches:
  refs/heads/trunk ce4ac63b5 -> 5ab3cc02b


AMBARI-17687: [RU/Downgrade] ranger service goes down in between of RU 
downgrade (Mugdha Varadkar via jluniya)


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

Branch: refs/heads/trunk
Commit: 5ab3cc02b2d2e03f9a9b8b4bbe4ca676bd620b57
Parents: ce4ac63
Author: Jayush Luniya <[email protected]>
Authored: Fri Jul 15 10:53:21 2016 -0700
Committer: Jayush Luniya <[email protected]>
Committed: Fri Jul 15 10:53:21 2016 -0700

----------------------------------------------------------------------
 .../ATLAS/0.1.0.2.3/package/scripts/params.py   |  6 +++--
 .../0.96.0.2.0/package/scripts/params_linux.py  |  7 +++---
 .../2.1.0.2.0/package/scripts/params_linux.py   |  6 ++---
 .../0.12.0.2.0/package/scripts/params_linux.py  |  2 +-
 .../KAFKA/0.8.1/package/scripts/params.py       |  6 +++--
 .../0.5.0.2.2/package/scripts/params_linux.py   |  6 +++--
 .../RANGER/0.4.0/package/scripts/params.py      | 24 +++++++++++---------
 .../0.5.0.2.3/package/scripts/params.py         | 13 +++++++----
 .../STORM/0.9.1/package/scripts/params_linux.py |  6 +++--
 .../2.1.0.2.0/package/scripts/params_linux.py   |  6 +++--
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml     |  1 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml     |  1 +
 12 files changed, 51 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
index 5cfb9dd..5a3c723 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
@@ -89,6 +89,8 @@ version = default("/commandParams/version", None)
 stack_version_unformatted = config['hostLevelParams']['stack_version']
 stack_version_formatted = format_stack_version(stack_version_unformatted)
 
+version_for_stack_feature_checks = version if version is not None else 
stack_version_formatted
+
 metadata_home = os.environ['METADATA_HOME_DIR'] if 'METADATA_HOME_DIR' in 
os.environ else format('{stack_root}/current/atlas-server')
 metadata_bin = format("{metadata_home}/bin")
 
@@ -208,8 +210,8 @@ for host in zookeeper_hosts:
 
 
 # Atlas Ranger plugin configurations
-stack_supports_atlas_ranger_plugin = stack_version_formatted and 
check_stack_feature(StackFeature.ATLAS_RANGER_PLUGIN_SUPPORT, 
stack_version_formatted)
-stack_supports_ranger_kerberos = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
stack_version_formatted)
+stack_supports_atlas_ranger_plugin = 
check_stack_feature(StackFeature.ATLAS_RANGER_PLUGIN_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
 retry_enabled = default("/commandParams/command_retry_enabled", False)
 
 ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
index abff409..7d1682d 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
@@ -47,7 +47,6 @@ sudo = AMBARI_SUDO_BINARY
 stack_name = status_params.stack_name
 agent_stack_retry_on_unavailability = 
config['hostLevelParams']['agent_stack_retry_on_unavailability']
 agent_stack_retry_count = expect("/hostLevelParams/agent_stack_retry_count", 
int)
-
 version = default("/commandParams/version", None)
 component_directory = status_params.component_directory
 etc_prefix_dir = "/etc/hbase"
@@ -55,7 +54,10 @@ etc_prefix_dir = "/etc/hbase"
 stack_version_unformatted = status_params.stack_version_unformatted
 stack_version_formatted = status_params.stack_version_formatted
 stack_root = status_params.stack_root
-stack_supports_ranger_kerberos = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
stack_version_formatted)
+
+version_for_stack_feature_checks = version if version is not None else 
stack_version_formatted
+stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
 
 # hadoop default parameters
 hadoop_bin_dir = stack_select.get_hadoop_dir("bin")
@@ -258,7 +260,6 @@ HdfsResource = functools.partial(
 )
 
 # ranger host
-stack_supports_ranger_audit_db = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
stack_version_formatted)
 ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
 has_ranger_admin = not len(ranger_admin_hosts) == 0
 xml_configurations_supported = 
config['configurations']['ranger-env']['xml_configurations_supported']

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
index f24bd83..93987be 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py
@@ -38,7 +38,6 @@ from resource_management.libraries.functions import 
get_kinit_path
 from resource_management.libraries.functions.get_not_managed_resources import 
get_not_managed_resources
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
-
 from resource_management.libraries.functions.format_jvm_option import 
format_jvm_option
 from resource_management.libraries.functions.get_lzo_packages import 
get_lzo_packages
 from resource_management.libraries.functions.is_empty import is_empty
@@ -57,7 +56,6 @@ stack_version_unformatted = 
config['hostLevelParams']['stack_version']
 stack_version_formatted = format_stack_version(stack_version_unformatted)
 agent_stack_retry_on_unavailability = 
config['hostLevelParams']['agent_stack_retry_on_unavailability']
 agent_stack_retry_count = expect("/hostLevelParams/agent_stack_retry_count", 
int)
-stack_supports_ranger_kerberos = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
stack_version_formatted)
 
 # there is a stack upgrade which has not yet been finalized; it's currently 
suspended
 upgrade_suspended = default("roleParams/upgrade_suspended", False)
@@ -70,6 +68,9 @@ version = default("/commandParams/version", None)
 # are started using different commands.
 desired_namenode_role = default("/commandParams/desired_namenode_role", None)
 
+version_for_stack_feature_checks = version if version is not None else 
stack_version_formatted
+stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
 
 security_enabled = config['configurations']['cluster-env']['security_enabled']
 hdfs_user = status_params.hdfs_user
@@ -388,7 +389,6 @@ mapred_pid_dir_prefix = 
default("/configurations/mapred-env/mapred_pid_dir_prefi
 mapred_log_dir_prefix = 
default("/configurations/mapred-env/mapred_log_dir_prefix","/var/log/hadoop-mapreduce")
 
 # ranger host
-stack_supports_ranger_audit_db = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
stack_version_formatted)
 ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
 has_ranger_admin = not len(ranger_admin_hosts) == 0
 xml_configurations_supported = 
config['configurations']['ranger-env']['xml_configurations_supported']

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index c5f8fc3..6f8d588 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -86,6 +86,7 @@ version_for_stack_feature_checks = version if version is not 
None else stack_ver
 # Upgrade direction
 upgrade_direction = default("/commandParams/upgrade_direction", None)
 stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
 
 # component ROLE directory (like hive-metastore or hive-server2-hive2)
 component_directory = status_params.component_directory
@@ -609,7 +610,6 @@ if has_hive_interactive:
   pass
 
 # ranger host
-stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
 ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
 has_ranger_admin = not len(ranger_admin_hosts) == 0
 xml_configurations_supported = 
config['configurations']['ranger-env']['xml_configurations_supported']

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
index f47eee4..9068b0c 100644
--- 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
@@ -53,7 +53,10 @@ host_sys_prepped = 
default("/hostLevelParams/host_sys_prepped", False)
 stack_version_unformatted = config['hostLevelParams']['stack_version']
 stack_version_formatted = format_stack_version(stack_version_unformatted)
 upgrade_direction = default("/commandParams/upgrade_direction", None)
-stack_supports_ranger_kerberos = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
stack_version_formatted)
+
+version_for_stack_feature_checks = version if version is not None else 
stack_version_formatted
+stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
 
 # When downgrading the 'version' and 'current_version' are both pointing to 
the downgrade-target version
 # downgrade_from_version provides the source-version the downgrade is 
happening from
@@ -161,7 +164,6 @@ else:
 # ***********************  RANGER PLUGIN CHANGES ***********************
 # ranger host
 # **********************************************************************
-stack_supports_ranger_audit_db = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
stack_version_formatted)
 ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
 has_ranger_admin = not len(ranger_admin_hosts) == 0
 xml_configurations_supported = 
config['configurations']['ranger-env']['xml_configurations_supported']

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
index 7f94e67..ac21b49 100644
--- 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params_linux.py
@@ -51,7 +51,10 @@ version_formatted = format_stack_version(version)
 # E.g., 2.3
 stack_version_unformatted = config['hostLevelParams']['stack_version']
 stack_version_formatted = format_stack_version(stack_version_unformatted)
-stack_supports_ranger_kerberos = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
stack_version_formatted)
+
+version_for_stack_feature_checks = version if version is not None else 
stack_version_formatted
+stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
 
 # This is the version whose state is CURRENT. During an RU, this is the source 
version.
 # DO NOT format it since we need the build number too.
@@ -247,7 +250,6 @@ if security_enabled:
   knox_principal_name = 
config['configurations']['knox-env']['knox_principal_name'].replace('_HOST',_hostname_lowercase)
 
 # ranger host
-stack_supports_ranger_audit_db = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
stack_version_formatted)
 ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
 has_ranger_admin = not len(ranger_admin_hosts) == 0
 xml_configurations_supported = 
config['configurations']['ranger-env']['xml_configurations_supported']

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/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 84e90e0..6ff833b 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
@@ -56,17 +56,19 @@ xml_configurations_supported = 
config['configurations']['ranger-env']['xml_confi
 
 create_db_dbuser = config['configurations']['ranger-env']['create_db_dbuser']
 
-stack_supports_rolling_upgrade = stack_version_formatted and 
check_stack_feature(StackFeature.ROLLING_UPGRADE, stack_version_formatted)
-stack_supports_config_versioning =  stack_version_formatted and 
check_stack_feature(StackFeature.CONFIG_VERSIONING, stack_version_formatted)
-stack_supports_usersync_non_root =  stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_USERSYNC_NON_ROOT, 
stack_version_formatted)
-stack_supports_ranger_tagsync =  stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_TAGSYNC_COMPONENT, 
stack_version_formatted)
-stack_supports_ranger_audit_db = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
stack_version_formatted)
-stack_supports_ranger_log4j =  stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_LOG4J_SUPPORT, stack_version_formatted)
-stack_supports_ranger_kerberos = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
stack_version_formatted)
-stack_supports_usersync_passwd = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_USERSYNC_PASSWORD_JCEKS, 
stack_version_formatted)
-stack_supports_logsearch_client = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_INSTALL_LOGSEARCH_CLIENT, 
stack_version_formatted)
-stack_supports_pid = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_PID_SUPPORT, stack_version_formatted)
-stack_supports_ranger_admin_password_change = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_ADMIN_PASSWD_CHANGE, 
stack_version_formatted)
+version_for_stack_feature_checks = version if version is not None else 
stack_version_formatted
+
+stack_supports_rolling_upgrade = 
check_stack_feature(StackFeature.ROLLING_UPGRADE, 
version_for_stack_feature_checks)
+stack_supports_config_versioning = 
check_stack_feature(StackFeature.CONFIG_VERSIONING, 
version_for_stack_feature_checks)
+stack_supports_usersync_non_root = 
check_stack_feature(StackFeature.RANGER_USERSYNC_NON_ROOT, 
version_for_stack_feature_checks)
+stack_supports_ranger_tagsync = 
check_stack_feature(StackFeature.RANGER_TAGSYNC_COMPONENT, 
version_for_stack_feature_checks)
+stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_log4j = 
check_stack_feature(StackFeature.RANGER_LOG4J_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_usersync_passwd = 
check_stack_feature(StackFeature.RANGER_USERSYNC_PASSWORD_JCEKS, 
version_for_stack_feature_checks)
+stack_supports_logsearch_client = 
check_stack_feature(StackFeature.RANGER_INSTALL_LOGSEARCH_CLIENT, 
version_for_stack_feature_checks)
+stack_supports_pid = check_stack_feature(StackFeature.RANGER_PID_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_admin_password_change = 
check_stack_feature(StackFeature.RANGER_ADMIN_PASSWD_CHANGE, 
version_for_stack_feature_checks)
 
 downgrade_from_version = default("/commandParams/downgrade_from_version", None)
 upgrade_direction = default("/commandParams/upgrade_direction", None)

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/params.py
index 73cfbff..6814ca2 100755
--- 
a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/params.py
@@ -38,10 +38,14 @@ version = default("/commandParams/version", None)
 stack_version_unformatted = config['hostLevelParams']['stack_version']
 stack_version_formatted = format_stack_version(stack_version_unformatted)
 
-stack_supports_config_versioning =  stack_version_formatted and 
check_stack_feature(StackFeature.CONFIG_VERSIONING, stack_version_formatted)
-stack_support_kms_hsm = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KMS_HSM_SUPPORT, 
stack_version_formatted)
-stack_supports_ranger_kerberos = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
stack_version_formatted)
-stack_supports_pid = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KMS_PID_SUPPORT, 
stack_version_formatted)
+version_for_stack_feature_checks = version if version is not None else 
stack_version_formatted
+
+stack_supports_config_versioning = 
check_stack_feature(StackFeature.CONFIG_VERSIONING, 
version_for_stack_feature_checks)
+stack_support_kms_hsm = 
check_stack_feature(StackFeature.RANGER_KMS_HSM_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_pid = check_stack_feature(StackFeature.RANGER_KMS_PID_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
+
 hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 security_enabled = config['configurations']['cluster-env']['security_enabled']
 
@@ -58,7 +62,6 @@ jdk_location = config['hostLevelParams']['jdk_location']
 kms_log4j = config['configurations']['kms-log4j']['content']
 
 # ranger host
-stack_supports_ranger_audit_db = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
stack_version_formatted)
 ranger_admin_hosts = config['clusterHostInfo']['ranger_admin_hosts'][0]
 has_ranger_admin = len(ranger_admin_hosts) > 0
 kms_host = config['clusterHostInfo']['ranger_kms_server_hosts'][0]

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
index 1807fc1..9c24f48 100644
--- 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
@@ -63,7 +63,10 @@ stack_version_formatted = 
status_params.stack_version_formatted
 stack_supports_ru = stack_version_formatted and 
check_stack_feature(StackFeature.ROLLING_UPGRADE, stack_version_formatted)
 stack_supports_storm_kerberos = stack_version_formatted and 
check_stack_feature(StackFeature.STORM_KERBEROS, stack_version_formatted)
 stack_supports_storm_ams = stack_version_formatted and 
check_stack_feature(StackFeature.STORM_AMS, stack_version_formatted)
-stack_supports_ranger_kerberos = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
stack_version_formatted)
+
+version_for_stack_feature_checks = version if version is not None else 
stack_version_formatted
+stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
 
 # default hadoop params
 rest_lib_dir = "/usr/lib/storm/contrib/storm-rest"
@@ -226,7 +229,6 @@ if has_atlas_in_cluster():
 
 
 # ranger host
-stack_supports_ranger_audit_db = stack_version_formatted and 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
stack_version_formatted)
 ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
 has_ranger_admin = not len(ranger_admin_hosts) == 0
 xml_configurations_supported = 
config['configurations']['ranger-env']['xml_configurations_supported']

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index 44a0446..b5a4c99 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -68,12 +68,15 @@ stack_version_formatted = 
functions.get_stack_version('hadoop-yarn-resourcemanag
 
 stack_supports_ru = stack_version_formatted_major and 
check_stack_feature(StackFeature.ROLLING_UPGRADE, stack_version_formatted_major)
 stack_supports_timeline_state_store = stack_version_formatted_major and 
check_stack_feature(StackFeature.TIMELINE_STATE_STORE, 
stack_version_formatted_major)
-stack_supports_ranger_kerberos = stack_version_formatted_major and 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
stack_version_formatted_major)
 
 # New Cluster Stack Version that is defined during the RESTART of a Stack 
Upgrade.
 # It cannot be used during the initial Cluser Install because the version is 
not yet known.
 version = default("/commandParams/version", None)
 
+version_for_stack_feature_checks = version if version is not None else 
stack_version_formatted_major
+stack_supports_ranger_kerberos = 
check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, 
version_for_stack_feature_checks)
+stack_supports_ranger_audit_db = 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
version_for_stack_feature_checks)
+
 hostname = config['hostname']
 
 # hadoop default parameters
@@ -354,7 +357,6 @@ cgroups_dir = "/cgroups_test/cpu"
 
 # ***********************  RANGER PLUGIN CHANGES ***********************
 # ranger host
-stack_supports_ranger_audit_db = stack_version_formatted_major and 
check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, 
stack_version_formatted_major)
 ranger_admin_hosts = default("/clusterHostInfo/ranger_admin_hosts", [])
 has_ranger_admin = not len(ranger_admin_hosts) == 0
 xml_configurations_supported = 
config['configurations']['ranger-env']['xml_configurations_supported']

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
index 98b62c3..47d9fdb 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
@@ -526,6 +526,7 @@
 
     <service name="RANGER">
       <component name="RANGER_ADMIN">
+        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
         <pre-upgrade>
           <task xsi:type="execute" hosts="all" summary="Stop Ranger Admin">
             <script>scripts/ranger_admin.py</script>

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3cc02/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
index 00a4193..dd7a87f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
@@ -521,6 +521,7 @@
 
     <service name="RANGER">
       <component name="RANGER_ADMIN">
+        <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
         <pre-upgrade>
           <task xsi:type="execute" hosts="all" summary="Stop Ranger Admin">
             <script>scripts/ranger_admin.py</script>

Reply via email to