http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py index 86b4010..1220090 100644 --- a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py +++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/spark_thrift_server.py @@ -23,8 +23,8 @@ import os from resource_management.libraries.script.script import Script from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions import stack_select +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.functions.copy_tarball import copy_to_hdfs from resource_management.libraries.functions.check_process_status import check_process_status from resource_management.core.logger import Logger @@ -70,10 +70,10 @@ class SparkThriftServer(Script): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.3.2.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.3.2.0') >= 0: Logger.info("Executing Spark Thrift Server Stack Upgrade pre-restart") conf_select.select(params.stack_name, "spark", params.version) - hdp_select.select("spark-thriftserver", params.version) + stack_select.select("spark-thriftserver", params.version) if __name__ == "__main__": SparkThriftServer().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py index 0006078..6218fe0 100644 --- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params_linux.py @@ -17,7 +17,7 @@ limitations under the License. """ -from resource_management.libraries.functions.version import format_hdp_stack_version +from resource_management.libraries.functions.version import format_stack_version from resource_management.libraries.functions.default import default from resource_management.libraries.functions.get_kinit_path import get_kinit_path from resource_management.libraries.script import Script @@ -40,7 +40,7 @@ ambari_server_hostname = config['clusterHostInfo']['ambari_server_host'][0] stack_name = default("/hostLevelParams/stack_name", None) stack_version_unformatted = str(config['hostLevelParams']['stack_version']) -hdp_stack_version = format_hdp_stack_version(stack_version_unformatted) +stack_version_formatted = format_stack_version(stack_version_unformatted) # New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade version = default("/commandParams/version", None) @@ -55,7 +55,7 @@ sqoop_bin_dir = "/usr/bin" zoo_conf_dir = "/etc/zookeeper" # HDP 2.2+ params -if Script.is_hdp_stack_greater_or_equal("2.2"): +if Script.is_stack_greater_or_equal("2.2"): sqoop_conf_dir = '/usr/hdp/current/sqoop-client/conf' sqoop_lib = '/usr/hdp/current/sqoop-client/lib' hadoop_home = '/usr/hdp/current/hbase-client' http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py index fa4d07d..06ffae4 100644 --- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py +++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/sqoop_client.py @@ -22,9 +22,9 @@ from resource_management.core.exceptions import ClientComponentHasNoStatus from resource_management.core.resources.system import Execute from resource_management.libraries.script.script import Script from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions.format import format -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version from sqoop import sqoop from ambari_commons.os_family_impl import OsFamilyImpl from ambari_commons import OSConst @@ -51,9 +51,9 @@ class SqoopClientDefault(SqoopClient): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "sqoop", params.version) - hdp_select.select("sqoop-client", params.version) + stack_select.select("sqoop-client", params.version) @OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py index 7dfa0b9..950a93e 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/drpc_server.py @@ -22,10 +22,10 @@ import sys from resource_management.libraries.functions import check_process_status from resource_management.libraries.script import Script from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import format from resource_management.core.resources.system import Execute -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version from storm import storm from service import service from service_check import ServiceCheck @@ -52,9 +52,9 @@ class DrpcServer(Script): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "storm", params.version) - hdp_select.select("storm-client", params.version) + stack_select.select("storm-client", params.version) def start(self, env, upgrade_type=None): import params http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py index 5bad428..df2db1c 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus.py @@ -23,9 +23,9 @@ from resource_management.libraries.functions import check_process_status from resource_management.libraries.script import Script from resource_management.libraries.functions import format from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.core.resources.system import Execute -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version from storm import storm from service import service from resource_management.libraries.functions.security_commons import build_expectations, \ @@ -56,10 +56,10 @@ class NimbusDefault(Nimbus): def pre_upgrade_restart(self, env, upgrade_type=None): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "storm", params.version) - hdp_select.select("storm-client", params.version) - hdp_select.select("storm-nimbus", params.version) + stack_select.select("storm-client", params.version) + stack_select.select("storm-nimbus", params.version) def start(self, env, upgrade_type=None): http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py index 75125dd..1197650 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/nimbus_prod.py @@ -23,10 +23,10 @@ from resource_management.libraries.script import Script from storm import storm from supervisord_service import supervisord_service, supervisord_check_status from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import format from resource_management.core.resources.system import Execute -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version class Nimbus(Script): @@ -47,10 +47,10 @@ class Nimbus(Script): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "storm", params.version) - hdp_select.select("storm-client", params.version) - hdp_select.select("storm-nimbus", params.version) + stack_select.select("storm-client", params.version) + stack_select.select("storm-nimbus", params.version) def start(self, env, upgrade_type=None): import params http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py index 33615ba..89ffcad 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_linux.py @@ -25,12 +25,12 @@ import status_params from ambari_commons.constants import AMBARI_SUDO_BINARY from resource_management.libraries.functions.constants import Direction from resource_management.libraries.functions import format -from resource_management.libraries.functions.version import format_hdp_stack_version +from resource_management.libraries.functions.version import format_stack_version from resource_management.libraries.functions.default import default from resource_management.libraries.functions.get_bare_principal import get_bare_principal from resource_management.libraries.script import Script from resource_management.libraries.resources.hdfs_resource import HdfsResource -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import conf_select from resource_management.libraries.functions import get_kinit_path @@ -47,8 +47,8 @@ storm_component_home_dir = status_params.storm_component_home_dir conf_dir = status_params.conf_dir stack_version_unformatted = str(config['hostLevelParams']['stack_version']) -hdp_stack_version = format_hdp_stack_version(stack_version_unformatted) -stack_is_hdp22_or_further = Script.is_hdp_stack_greater_or_equal("2.2") +stack_version_formatted = format_stack_version(stack_version_unformatted) +stack_is_hdp22_or_further = Script.is_stack_greater_or_equal("2.2") # default hadoop params rest_lib_dir = "/usr/lib/storm/contrib/storm-rest" @@ -285,7 +285,7 @@ hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab'] if hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name'] if has_namenode else None hdfs_site = config['configurations']['hdfs-site'] if has_namenode else None default_fs = config['configurations']['core-site']['fs.defaultFS'] if has_namenode else None -hadoop_bin_dir = hdp_select.get_hadoop_dir("bin") if has_namenode else None +hadoop_bin_dir = stack_select.get_hadoop_dir("bin") if has_namenode else None hadoop_conf_dir = conf_select.get_hadoop_conf_dir() if has_namenode else None kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py index 3408bfb..90bc76d 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params_windows.py @@ -25,7 +25,7 @@ from resource_management.libraries.functions.default import default # server configurations config = Script.get_config() -stack_is_hdp23_or_further = Script.is_hdp_stack_greater_or_equal("2.3") +stack_is_hdp23_or_further = Script.is_stack_greater_or_equal("2.3") hdp_root = os.path.abspath(os.path.join(os.environ["HADOOP_HOME"],"..")) conf_dir = os.environ["STORM_CONF_DIR"] http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py index eb81301..07065c2 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/rest_api.py @@ -22,10 +22,10 @@ import sys from resource_management.libraries.functions import check_process_status from resource_management.libraries.script import Script from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import format from resource_management.core.resources.system import Execute -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version from storm import storm from service import service http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/status_params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/status_params.py index 49dee47..984a4ba 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/status_params.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/status_params.py @@ -66,7 +66,7 @@ else: storm_component_home_dir = "/usr/lib/storm" conf_dir = "/etc/storm/conf" - if Script.is_hdp_stack_greater_or_equal("2.2"): + if Script.is_stack_greater_or_equal("2.2"): storm_component_home_dir = format("/usr/hdp/current/{component_directory}") conf_dir = format("/usr/hdp/current/{component_directory}/conf") http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm.py index 43736fa..a15b500 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/storm.py @@ -131,7 +131,7 @@ def storm(name=None): TemplateConfig(format("{conf_dir}/storm_jaas.conf"), owner=params.storm_user ) - if params.hdp_stack_version != "" and compare_versions(params.hdp_stack_version, '2.2') >= 0: + if params.stack_version_formatted != "" and compare_versions(params.stack_version_formatted, '2.2') >= 0: TemplateConfig(format("{conf_dir}/client_jaas.conf"), owner=params.storm_user ) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py index 33f06b1..99279be 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor.py @@ -22,10 +22,10 @@ import sys from resource_management.libraries.functions import check_process_status from resource_management.libraries.script import Script from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import format from resource_management.core.resources.system import Execute -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version from storm import storm from service import service from ambari_commons import OSConst @@ -74,10 +74,10 @@ class SupervisorDefault(Supervisor): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "storm", params.version) - hdp_select.select("storm-client", params.version) - hdp_select.select("storm-supervisor", params.version) + stack_select.select("storm-client", params.version) + stack_select.select("storm-supervisor", params.version) def start(self, env, upgrade_type=None): import params http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py index 3efb9f4..48f65ba 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/supervisor_prod.py @@ -24,10 +24,10 @@ from service import service from supervisord_service import supervisord_service, supervisord_check_status from resource_management.libraries.script import Script from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import format from resource_management.core.resources.system import Execute -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version class Supervisor(Script): @@ -48,10 +48,10 @@ class Supervisor(Script): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "storm", params.version) - hdp_select.select("storm-client", params.version) - hdp_select.select("storm-supervisor", params.version) + stack_select.select("storm-client", params.version) + stack_select.select("storm-supervisor", params.version) def start(self, env, upgrade_type=None): import params http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py index 3053b05..6c2a5b7 100644 --- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py +++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/ui_server.py @@ -25,11 +25,11 @@ from service_check import ServiceCheck from resource_management.libraries.functions import check_process_status from resource_management.libraries.script import Script from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import format from resource_management.core.resources.system import Link from resource_management.core.resources.system import Execute -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ FILE_TYPE_JAAS_CONF @@ -79,9 +79,9 @@ class UiServerDefault(UiServer): def pre_upgrade_restart(self, env, upgrade_type=None): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "storm", params.version) - hdp_select.select("storm-client", params.version) + stack_select.select("storm-client", params.version) def link_metrics_sink_jar(self): # Add storm metrics reporter JAR to storm-ui-server classpath. http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py index da52556..cc87973 100644 --- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py @@ -21,8 +21,8 @@ import os from resource_management.libraries.resources import HdfsResource from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select -from resource_management.libraries.functions.version import format_hdp_stack_version +from resource_management.libraries.functions import stack_select +from resource_management.libraries.functions.version import format_stack_version from resource_management.libraries.functions.default import default from resource_management.libraries.functions import get_kinit_path from resource_management.libraries.script.script import Script @@ -35,25 +35,25 @@ stack_name = default("/hostLevelParams/stack_name", None) # This is expected to be of the form #.#.#.# stack_version_unformatted = str(config['hostLevelParams']['stack_version']) -hdp_stack_version = format_hdp_stack_version(stack_version_unformatted) +stack_version_formatted = format_stack_version(stack_version_unformatted) # New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade version = default("/commandParams/version", None) # default hadoop parameters hadoop_home = '/usr' -hadoop_bin_dir = hdp_select.get_hadoop_dir("bin") +hadoop_bin_dir = stack_select.get_hadoop_dir("bin") hadoop_conf_dir = conf_select.get_hadoop_conf_dir() tez_etc_dir = "/etc/tez" config_dir = "/etc/tez/conf" tez_examples_jar = "/usr/lib/tez/tez-mapreduce-examples*.jar" # hadoop parameters for 2.2+ -if Script.is_hdp_stack_greater_or_equal("2.2"): +if Script.is_stack_greater_or_equal("2.2"): tez_examples_jar = "/usr/hdp/current/tez-client/tez-examples*.jar" # tez only started linking /usr/hdp/x.x.x.x/tez-client/conf in HDP 2.3+ -if Script.is_hdp_stack_greater_or_equal("2.3"): +if Script.is_stack_greater_or_equal("2.3"): # !!! use realpath for now since the symlink exists but is broken and a # broken symlink messes with the DirectoryProvider class config_dir = os.path.realpath("/usr/hdp/current/tez-client/conf") http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py index 636d092..ad80830 100644 --- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py +++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py @@ -19,7 +19,7 @@ limitations under the License. import os -from resource_management.libraries.functions.get_hdp_version import get_hdp_version +from resource_management.libraries.functions.get_stack_version import get_stack_version from resource_management.libraries.script.script import Script config = Script.get_config() @@ -34,7 +34,7 @@ try: except KeyError: hadoop_classpath_prefix_template = "" -hdp_stack_version = "" +stack_version_formatted = "" hdp_root = None try: @@ -43,11 +43,11 @@ except: pass def refresh_tez_state_dependent_params(): - global tez_home_dir, tez_conf_dir, hdp_stack_version + global tez_home_dir, tez_conf_dir, stack_version_formatted tez_home_dir = os.environ["TEZ_HOME"] tez_conf_dir = os.path.join(tez_home_dir, "conf") # this is not available on INSTALL action because hdp-select is not available - hdp_stack_version = get_hdp_version("tez") + stack_version_formatted = get_stack_version("tez") if os.environ.has_key("TEZ_HOME"): http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/pre_upgrade.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/pre_upgrade.py b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/pre_upgrade.py index a38d917..1faedf9 100644 --- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/pre_upgrade.py +++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/pre_upgrade.py @@ -38,8 +38,8 @@ class TezPreUpgrade(Script): Logger.info("Before starting Stack Upgrade, check if tez tarball has been copied to HDFS.") - if params.hdp_stack_version and compare_versions(params.hdp_stack_version, '2.2.0.0') >= 0: - Logger.info("Stack version {0} is sufficient to check if need to copy tez.tar.gz to HDFS.".format(params.hdp_stack_version)) + if params.stack_version_formatted and compare_versions(params.stack_version_formatted, '2.2.0.0') >= 0: + Logger.info("Stack version {0} is sufficient to check if need to copy tez.tar.gz to HDFS.".format(params.stack_version_formatted)) # Force it to copy the current version of the tez tarball, rather than the version the RU will go to. resource_created = copy_to_hdfs( http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/service_check.py index 1747cf3..b70256c 100644 --- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/service_check.py @@ -67,7 +67,7 @@ class TezServiceCheckLinux(TezServiceCheck): source = format("{tmp_dir}/sample-tez-test"), ) - if params.hdp_stack_version and compare_versions(params.hdp_stack_version, '2.2.0.0') >= 0: + if params.stack_version_formatted and compare_versions(params.stack_version_formatted, '2.2.0.0') >= 0: copy_to_hdfs("tez", params.user_group, params.hdfs_user, host_sys_prepped=params.host_sys_prepped) params.HdfsResource(None, action = "execute") http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py index 8bdabf1..e770d9b 100644 --- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py +++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/tez_client.py @@ -29,9 +29,9 @@ from ambari_commons.os_utils import copy_file, extract_path_component from resource_management.core.exceptions import ClientComponentHasNoStatus from resource_management.core.source import InlineTemplate from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select -from resource_management.libraries.functions.get_hdp_version import get_hdp_version -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions import stack_select +from resource_management.libraries.functions.get_stack_version import get_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.script.script import Script from tez import tez @@ -55,10 +55,10 @@ class TezClientLinux(TezClient): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "tez", params.version) conf_select.select(params.stack_name, "hadoop", params.version) - hdp_select.select("hadoop-client", params.version) + stack_select.select("hadoop-client", params.version) def install(self, env): self.install_packages(env) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py index 7644225..2966581 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py @@ -21,8 +21,8 @@ Ambari Agent from resource_management import * from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions import stack_select +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties,\ FILE_TYPE_XML @@ -70,9 +70,9 @@ class ApplicationTimelineServerDefault(ApplicationTimelineServer): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "hadoop", params.version) - hdp_select.select("hadoop-yarn-timelineserver", params.version) + stack_select.select("hadoop-yarn-timelineserver", params.version) def status(self, env): import status_params http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py index 5d95c5c..53b0e53 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py @@ -22,10 +22,10 @@ Ambari Agent from resource_management.libraries.script.script import Script from resource_management.libraries.resources.hdfs_resource import HdfsResource from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions.check_process_status import check_process_status from resource_management.libraries.functions.copy_tarball import copy_to_hdfs -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.functions.format import format from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ @@ -77,9 +77,9 @@ class HistoryServerDefault(HistoryServer): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "hadoop", params.version) - hdp_select.select("hadoop-mapreduce-historyserver", params.version) + stack_select.select("hadoop-mapreduce-historyserver", params.version) # MC Hammer said, "Can't touch this" copy_to_hdfs("mapreduce", params.user_group, params.hdfs_user, host_sys_prepped=params.host_sys_prepped) copy_to_hdfs("tez", params.user_group, params.hdfs_user, host_sys_prepped=params.host_sys_prepped) @@ -91,7 +91,7 @@ class HistoryServerDefault(HistoryServer): env.set_params(params) self.configure(env) # FOR SECURITY - if params.hdp_stack_version_major and compare_versions(params.hdp_stack_version_major, '2.2.0.0') >= 0: + if params.stack_version_formatted_major and compare_versions(params.stack_version_formatted_major, '2.2.0.0') >= 0: # MC Hammer said, "Can't touch this" resource_created = copy_to_hdfs( "mapreduce", http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py index 7ceadf0..9fc1e32 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/mapreduce2_client.py @@ -22,7 +22,7 @@ Ambari Agent import sys from resource_management import * from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from yarn import yarn from ambari_commons import OSConst from ambari_commons.os_family_impl import OsFamilyImpl @@ -56,9 +56,9 @@ class MapReduce2ClientDefault(MapReduce2Client): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "hadoop", params.version) - hdp_select.select("hadoop-client", params.version) + stack_select.select("hadoop-client", params.version) if __name__ == "__main__": http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py index d508d55..fd14d0f 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager.py @@ -23,8 +23,8 @@ import nodemanager_upgrade from resource_management import * from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions import stack_select +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.functions.format import format from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ @@ -72,9 +72,9 @@ class NodemanagerDefault(Nodemanager): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "hadoop", params.version) - hdp_select.select("hadoop-yarn-nodemanager", params.version) + stack_select.select("hadoop-yarn-nodemanager", params.version) def post_upgrade_restart(self, env, upgrade_type=None): Logger.info("Executing NodeManager Stack Upgrade post-restart") http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/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 0ca632f..e02a55d 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 @@ -23,10 +23,10 @@ import os from resource_management.libraries.script.script import Script from resource_management.libraries.resources.hdfs_resource import HdfsResource from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import format from resource_management.libraries.functions import get_kinit_path -from resource_management.libraries.functions.version import format_hdp_stack_version +from resource_management.libraries.functions.version import format_stack_version from resource_management.libraries.functions.default import default from resource_management.libraries import functions @@ -54,8 +54,8 @@ stack_name = default("/hostLevelParams/stack_name", None) # This is expected to be of the form #.#.#.# stack_version_unformatted = str(config['hostLevelParams']['stack_version']) -hdp_stack_version_major = format_hdp_stack_version(stack_version_unformatted) -hdp_stack_version = functions.get_hdp_version('hadoop-yarn-resourcemanager') +stack_version_formatted_major = format_stack_version(stack_version_unformatted) +stack_version_formatted = functions.get_stack_version('hadoop-yarn-resourcemanager') # 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. @@ -64,9 +64,9 @@ version = default("/commandParams/version", None) hostname = config['hostname'] # hadoop default parameters -hadoop_libexec_dir = hdp_select.get_hadoop_dir("libexec") -hadoop_bin = hdp_select.get_hadoop_dir("sbin") -hadoop_bin_dir = hdp_select.get_hadoop_dir("bin") +hadoop_libexec_dir = stack_select.get_hadoop_dir("libexec") +hadoop_bin = stack_select.get_hadoop_dir("sbin") +hadoop_bin_dir = stack_select.get_hadoop_dir("bin") hadoop_conf_dir = conf_select.get_hadoop_conf_dir() hadoop_yarn_home = '/usr/lib/hadoop-yarn' hadoop_mapred2_jar_location = "/usr/lib/hadoop-mapreduce" @@ -76,7 +76,7 @@ yarn_container_bin = "/usr/lib/hadoop-yarn/bin" hadoop_java_io_tmpdir = os.path.join(tmp_dir, "hadoop_java_io_tmpdir") # hadoop parameters for 2.2+ -if Script.is_hdp_stack_greater_or_equal("2.2"): +if Script.is_stack_greater_or_equal("2.2"): # MapR directory root mapred_role_root = "hadoop-mapreduce-client" command_role = default("/role", "") http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py index d40abff..e51ca8a 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/resourcemanager.py @@ -21,10 +21,10 @@ Ambari Agent from resource_management.libraries.script.script import Script from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions.check_process_status import check_process_status from resource_management.libraries.functions.format import format -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ FILE_TYPE_XML @@ -105,9 +105,9 @@ class ResourcemanagerDefault(Resourcemanager): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "hadoop", params.version) - hdp_select.select("hadoop-yarn-resourcemanager", params.version) + stack_select.select("hadoop-yarn-resourcemanager", params.version) def start(self, env, upgrade_type=None): import params http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py index cd4d558..d82b630 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py @@ -85,7 +85,7 @@ class ServiceCheckDefault(ServiceCheck): import params env.set_params(params) - if params.hdp_stack_version_major != "" and compare_versions(params.hdp_stack_version_major, '2.2') >= 0: + if params.stack_version_formatted_major != "" and compare_versions(params.stack_version_formatted_major, '2.2') >= 0: path_to_distributed_shell_jar = "/usr/hdp/current/hadoop-yarn-client/hadoop-yarn-applications-distributedshell.jar" else: path_to_distributed_shell_jar = "/usr/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell*.jar" http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py index edfbe44..e05ed60 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py @@ -253,7 +253,7 @@ def yarn(name = None): ) # if HDP stack is greater than/equal to 2.2, mkdir for state store property (added in 2.2) - if (Script.is_hdp_stack_greater_or_equal("2.2")): + if (Script.is_stack_greater_or_equal("2.2")): Directory(params.ats_leveldb_state_store_dir, owner=params.yarn_user, group=params.user_group, http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py index 0c6115f..d300279 100644 --- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py +++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn_client.py @@ -22,7 +22,7 @@ Ambari Agent import sys from resource_management import * from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from yarn import yarn from ambari_commons import OSConst from ambari_commons.os_family_impl import OsFamilyImpl @@ -56,9 +56,9 @@ class YarnClientDefault(YarnClient): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "hadoop", params.version) - hdp_select.select("hadoop-client", params.version) + stack_select.select("hadoop-client", params.version) if __name__ == "__main__": http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py index c6264ff..9ff9125 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py @@ -22,7 +22,7 @@ import status_params import os from resource_management.libraries.functions import format -from resource_management.libraries.functions.version import format_hdp_stack_version +from resource_management.libraries.functions.version import format_stack_version from resource_management.libraries.functions.default import default from resource_management.libraries.functions import get_kinit_path from resource_management.libraries.script.script import Script @@ -32,7 +32,7 @@ config = Script.get_config() tmp_dir = Script.get_tmp_dir() stack_version_unformatted = str(config['hostLevelParams']['stack_version']) -hdp_stack_version = format_hdp_stack_version(stack_version_unformatted) +stack_version_formatted = format_stack_version(stack_version_unformatted) stack_name = default("/hostLevelParams/stack_name", None) current_version = default("/hostLevelParams/current_version", None) @@ -49,7 +49,7 @@ config_dir = "/etc/zookeeper/conf" zk_smoke_out = os.path.join(tmp_dir, "zkSmoke.out") # hadoop parameters for 2.2+ -if Script.is_hdp_stack_greater_or_equal("2.2"): +if Script.is_stack_greater_or_equal("2.2"): zk_home = format("/usr/hdp/current/{component_directory}") zk_bin = format("/usr/hdp/current/{component_directory}/bin") zk_cli_shell = format("/usr/hdp/current/{component_directory}/bin/zkCli.sh") http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/status_params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/status_params.py index ae2a1fd..d18e4d7 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/status_params.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/status_params.py @@ -48,5 +48,5 @@ else: zk_user = config['configurations']['zookeeper-env']['zk_user'] config_dir = "/etc/zookeeper/conf" - if Script.is_hdp_stack_greater_or_equal("2.2"): + if Script.is_stack_greater_or_equal("2.2"): config_dir = format("/usr/hdp/current/{component_directory}/conf") http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py index 2727641..5712ce4 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py @@ -23,8 +23,8 @@ import sys from resource_management import * from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions import stack_select +from resource_management.libraries.functions.version import compare_versions, format_stack_version from ambari_commons import OSConst from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl @@ -36,9 +36,9 @@ def zookeeper(type = None, upgrade_type=None): # This path may be missing after Ambari upgrade. We need to create it. We need to do this before any configs will # be applied. if upgrade_type is None and not os.path.exists("/usr/hdp/current/zookeeper-server") and params.current_version\ - and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "zookeeper", params.current_version) - hdp_select.select("zookeeper-server", params.version) + stack_select.select("zookeeper-server", params.version) Directory(params.config_dir, owner=params.zk_user, http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py index 7a11fee..25ace24 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_client.py @@ -22,8 +22,8 @@ Ambari Agent import sys from resource_management import * from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions import stack_select +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.functions.format import format from ambari_commons import OSConst from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl @@ -65,9 +65,9 @@ class ZookeeperClientLinux(ZookeeperClient): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "zookeeper", params.version) - hdp_select.select("zookeeper-client", params.version) + stack_select.select("zookeeper-client", params.version) @OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY) class ZookeeperClientWindows(ZookeeperClient): http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py index 842deb0..d5b6898 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py @@ -24,8 +24,8 @@ import sys from resource_management.libraries.script.script import Script from resource_management.libraries.functions import get_unique_id_and_date from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions import stack_select +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.functions.security_commons import build_expectations, \ cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \ FILE_TYPE_JAAS_CONF @@ -74,9 +74,9 @@ class ZookeeperServerLinux(ZookeeperServer): import params env.set_params(params) - if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "zookeeper", params.version) - hdp_select.select("zookeeper-server", params.version) + stack_select.select("zookeeper-server", params.version) def post_upgrade_restart(self, env, upgrade_type=None): if upgrade_type == "nonrolling": http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py index afa332a..6fe0772 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py @@ -24,8 +24,8 @@ from resource_management import * from ambari_commons import OSConst from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions import stack_select +from resource_management.libraries.functions.version import compare_versions, format_stack_version @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT) def zookeeper_service(action='start', upgrade_type=None): @@ -33,9 +33,9 @@ def zookeeper_service(action='start', upgrade_type=None): # This path may be missing after Ambari upgrade. We need to create it. if upgrade_type is None and not os.path.exists("/usr/hdp/current/zookeeper-server") and params.current_version \ - and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: + and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "zookeeper", params.current_version) - hdp_select.select("zookeeper-server", params.version) + stack_select.select("zookeeper-server", params.version) cmd = format("env ZOOCFGDIR={config_dir} ZOOCFG=zoo.cfg {zk_bin}/zkServer.sh") http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py index 6f8ef9f..08bdcc3 100644 --- a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py +++ b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py @@ -34,8 +34,8 @@ from ambari_commons.os_check import OSCheck, OSConst from ambari_commons.str_utils import cbool, cint from resource_management.libraries.functions.packages_analyzer import allInstalledPackages from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions.hdp_select import get_hdp_versions -from resource_management.libraries.functions.version import compare_versions, format_hdp_stack_version +from resource_management.libraries.functions.stack_select import get_stack_versions +from resource_management.libraries.functions.version import compare_versions, format_stack_version from resource_management.libraries.functions.repo_version_history \ import read_actual_version_from_history_file, write_actual_version_to_history_file, REPO_VERSION_HISTORY_FILE from resource_management.core.resources.system import Execute @@ -83,10 +83,10 @@ class InstallPackages(Script): stack_id = config['commandParams']['stack_id'] # current stack information - self.current_hdp_stack_version = None + self.current_stack_version_formatted = None if 'stack_version' in config['hostLevelParams']: current_stack_version_unformatted = str(config['hostLevelParams']['stack_version']) - self.current_hdp_stack_version = format_hdp_stack_version(current_stack_version_unformatted) + self.current_stack_version_formatted = format_stack_version(current_stack_version_unformatted) stack_name = None @@ -145,7 +145,7 @@ class InstallPackages(Script): raise Fail("Failed to distribute repositories/install packages") # Initial list of versions, used to compute the new version installed - self.old_versions = get_hdp_versions(self.stack_root_folder) + self.old_versions = get_stack_versions(self.stack_root_folder) try: is_package_install_successful = False @@ -189,13 +189,13 @@ class InstallPackages(Script): if args[0] != "HDP": Logger.info("Unrecognized stack name {0}, cannot create config links".format(args[0])) - if compare_versions(format_hdp_stack_version(args[1]), "2.3.0.0") < 0: + if compare_versions(format_stack_version(args[1]), "2.3.0.0") < 0: Logger.info("Configuration symlinks are not needed for {0}, only HDP-2.3+".format(stack_version)) return for package_name, directories in conf_select.PACKAGE_DIRS.iteritems(): # if already on HDP 2.3, then we should skip making conf.backup folders - if self.current_hdp_stack_version and compare_versions(self.current_hdp_stack_version, '2.3') >= 0: + if self.current_stack_version_formatted and compare_versions(self.current_stack_version_formatted, '2.3') >= 0: Logger.info("The current cluster stack of {0} does not require backing up configurations; " "only conf-select versioned config directories will be created.".format(stack_version)) # only link configs for all known packages @@ -226,7 +226,7 @@ class InstallPackages(Script): Logger.info("Attempting to determine actual version with build number.") Logger.info("Old versions: {0}".format(self.old_versions)) - new_versions = get_hdp_versions(self.stack_root_folder) + new_versions = get_stack_versions(self.stack_root_folder) Logger.info("New versions: {0}".format(new_versions)) deltas = set(new_versions) - set(self.old_versions) @@ -268,7 +268,7 @@ class InstallPackages(Script): Logger.info("Installation of packages failed. Checking if installation was partially complete") Logger.info("Old versions: {0}".format(self.old_versions)) - new_versions = get_hdp_versions(self.stack_root_folder) + new_versions = get_stack_versions(self.stack_root_folder) Logger.info("New versions: {0}".format(new_versions)) deltas = set(new_versions) - set(self.old_versions) http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/custom_actions/scripts/ru_set_all.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/custom_actions/scripts/ru_set_all.py b/ambari-server/src/main/resources/custom_actions/scripts/ru_set_all.py index a573420..b8bf176 100644 --- a/ambari-server/src/main/resources/custom_actions/scripts/ru_set_all.py +++ b/ambari-server/src/main/resources/custom_actions/scripts/ru_set_all.py @@ -28,13 +28,13 @@ from resource_management.libraries.functions import conf_select from resource_management.libraries.functions.constants import Direction from resource_management.libraries.functions.default import default from resource_management.libraries.functions.version import compare_versions -from resource_management.libraries.functions.version import format_hdp_stack_version +from resource_management.libraries.functions.version import format_stack_version from resource_management.core import shell from resource_management.core.exceptions import Fail from resource_management.core.logger import Logger from resource_management.core.resources.system import Execute, Link, Directory -HDP_SELECT = '/usr/bin/hdp-select' +STACK_SELECT = '/usr/bin/hdp-select' class UpgradeSetAll(Script): """ @@ -56,14 +56,14 @@ class UpgradeSetAll(Script): cmd = ('/usr/bin/yum', 'clean', 'all') code, out = shell.call(cmd, sudo=True) - min_ver = format_hdp_stack_version("2.2") - real_ver = format_hdp_stack_version(version) + min_ver = format_stack_version("2.2") + real_ver = format_stack_version(version) if stack_name == "HDP": if compare_versions(real_ver, min_ver) >= 0: - cmd = ('ambari-python-wrap', HDP_SELECT, 'set', 'all', version) + cmd = ('ambari-python-wrap', STACK_SELECT, 'set', 'all', version) code, out = shell.call(cmd, sudo=True) - if compare_versions(real_ver, format_hdp_stack_version("2.3")) >= 0: + if compare_versions(real_ver, format_stack_version("2.3")) >= 0: # backup the old and symlink /etc/[component]/conf to /usr/hdp/current/[component] for k, v in conf_select.PACKAGE_DIRS.iteritems(): for dir_def in v: @@ -97,9 +97,9 @@ class UpgradeSetAll(Script): Logger.info("Unlinking all configs when downgrading from HDP 2.3 to 2.2") # normalize the versions - stack_23 = format_hdp_stack_version("2.3") - downgrade_to_version = format_hdp_stack_version(downgrade_to_version) - downgrade_from_version = format_hdp_stack_version(downgrade_from_version) + stack_23 = format_stack_version("2.3") + downgrade_to_version = format_stack_version(downgrade_to_version) + downgrade_from_version = format_stack_version(downgrade_from_version) # downgrade-to-version must be 2.2 (less than 2.3) if compare_versions(downgrade_to_version, stack_23) >= 0: http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/scripts/Ambaripreupload.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py b/ambari-server/src/main/resources/scripts/Ambaripreupload.py index 5ce75dd..941539c 100644 --- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py +++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py @@ -48,40 +48,40 @@ SQL_DRIVER_PATH = "/var/lib/ambari-server/resources/sqljdbc41.jar" """ This file provides helper methods needed for the versioning of RPMs. Specifically, it does dynamic variable -interpretation to replace strings like {{ hdp_stack_version }} where the value of the +interpretation to replace strings like {{ stack_version_formatted }} where the value of the variables cannot be determined ahead of time, but rather, depends on what files are found. -It assumes that {{ hdp_stack_version }} is constructed as ${major.minor.patch.rev}-${build_number} +It assumes that {{ stack_version_formatted }} is constructed as ${major.minor.patch.rev}-${build_number} E.g., 998.2.2.1.0-998 Please note that "-${build_number}" is optional. """ with Environment() as env: - def get_hdp_version(): + def get_stack_version(): if not options.hdp_version: # Ubuntu returns: "stdin: is not a tty", as subprocess output. tmpfile = tempfile.NamedTemporaryFile() out = None with open(tmpfile.name, 'r+') as file: - get_hdp_version_cmd = '/usr/bin/hdp-select status %s > %s' % ('hadoop-mapreduce-historyserver', tmpfile.name) - code, stdoutdata = shell.call(get_hdp_version_cmd) + get_stack_version_cmd = '/usr/bin/hdp-select status %s > %s' % ('hadoop-mapreduce-historyserver', tmpfile.name) + code, stdoutdata = shell.call(get_stack_version_cmd) out = file.read() pass if code != 0 or out is None: Logger.warning("Could not verify HDP version by calling '%s'. Return Code: %s, Output: %s." % - (get_hdp_version_cmd, str(code), str(out))) + (get_stack_version_cmd, str(code), str(out))) return 1 matches = re.findall(r"([\d\.]+\-\d+)", out) - hdp_version = matches[0] if matches and len(matches) > 0 else None + stack_version = matches[0] if matches and len(matches) > 0 else None - if not hdp_version: + if not stack_version: Logger.error("Could not parse HDP version from output of hdp-select: %s" % str(out)) return 1 else: - hdp_version = options.hdp_version + stack_version = options.hdp_version - return hdp_version + return stack_version parser = OptionParser() parser.add_option("-v", "--hdp-version", dest="hdp_version", default="", @@ -97,7 +97,7 @@ with Environment() as env: if len(args) > 0: hdfs_path_prefix = args[0] - hdp_version = get_hdp_version() + stack_version = get_stack_version() def getPropertyValueFromConfigXMLFile(xmlfile, name, defaultValue=None): xmldoc = minidom.parse(xmlfile) @@ -135,12 +135,12 @@ with Environment() as env: hdfs_path_prefix = hdfs_path_prefix hdfs_user = "hdfs" mapred_user ="mapred" - hadoop_bin_dir="/usr/hdp/" + hdp_version + "/hadoop/bin" + hadoop_bin_dir="/usr/hdp/" + stack_version + "/hadoop/bin" hadoop_conf_dir = "/etc/hadoop/conf" user_group = "hadoop" security_enabled = False oozie_user = "oozie" - execute_path = "/usr/hdp/" + hdp_version + "/hadoop/bin" + execute_path = "/usr/hdp/" + stack_version + "/hadoop/bin" ambari_libs_dir = "/var/lib/ambari-agent/lib" hdfs_site = ConfigDictionary({'dfs.webhdfs.enabled':False, }) @@ -157,7 +157,7 @@ with Environment() as env: export CATALINA_TMPDIR=${{CATALINA_TMPDIR:-/var/tmp/oozie}} export CATALINA_PID=${{CATALINA_PID:-/var/run/oozie/oozie.pid}} export OOZIE_CATALINA_HOME=/usr/lib/bigtop-tomcat - '''.format(hdp_version) + '''.format(stack_version) HdfsResource = functools.partial( HdfsResource, @@ -196,17 +196,17 @@ with Environment() as env: ) - def copy_tarballs_to_hdfs(source, dest, hdp_select_component_name, component_user, file_owner, group_owner): + def copy_tarballs_to_hdfs(source, dest, stack_select_component_name, component_user, file_owner, group_owner): """ :param tarball_prefix: Prefix of the tarball must be one of tez, hive, mr, pig - :param hdp_select_component_name: Component name to get the status to determine the version + :param stack_select_component_name: Component name to get the status to determine the version :param component_user: User that will execute the Hadoop commands :param file_owner: Owner of the files copied to HDFS (typically hdfs account) :param group_owner: Group owner of the files copied to HDFS (typically hadoop group) :return: Returns 0 on success, 1 if no files were copied, and in some cases may raise an exception. In order to call this function, params.py must have all of the following, - hdp_stack_version, kinit_path_local, security_enabled, hdfs_user, hdfs_principal_name, hdfs_user_keytab, + stack_version_formatted, kinit_path_local, security_enabled, hdfs_user, hdfs_principal_name, hdfs_user_keytab, hadoop_bin_dir, hadoop_conf_dir, and HdfsDirectory as a partial function. """ @@ -220,7 +220,7 @@ with Environment() as env: file_name = os.path.basename(component_tar_source_file) destination_file = os.path.join(component_tar_destination_folder, file_name) - destination_file = destination_file.replace("{{ hdp_stack_version }}", hdp_version) + destination_file = destination_file.replace("{{ stack_version_formatted }}", stack_version) kinit_if_needed = "" @@ -278,10 +278,10 @@ with Environment() as env: env.set_params(params) hadoop_conf_dir = params.hadoop_conf_dir - oozie_libext_dir = format("/usr/hdp/{hdp_version}/oozie/libext") + oozie_libext_dir = format("/usr/hdp/{stack_version}/oozie/libext") sql_driver_filename = os.path.basename(SQL_DRIVER_PATH) - oozie_home=format("/usr/hdp/{hdp_version}/oozie") - oozie_setup_sh=format("/usr/hdp/{hdp_version}/oozie/bin/oozie-setup.sh") + oozie_home=format("/usr/hdp/{stack_version}/oozie") + oozie_setup_sh=format("/usr/hdp/{stack_version}/oozie/bin/oozie-setup.sh") oozie_setup_sh_current="/usr/hdp/current/oozie-server/bin/oozie-setup.sh" oozie_tmp_dir = "/var/tmp/oozie" configure_cmds = [] @@ -353,7 +353,7 @@ with Environment() as env: ############################################### # PREPARE-WAR END [BEGIN] ############################################### - oozie_shared_lib = format("/usr/hdp/{hdp_version}/oozie/share") + oozie_shared_lib = format("/usr/hdp/{stack_version}/oozie/share") oozie_user = 'oozie' oozie_hdfs_user_dir = format("{hdfs_path_prefix}/user/{oozie_user}") kinit_if_needed = '' @@ -376,12 +376,12 @@ with Environment() as env: ) print "Copying tarballs..." - copy_tarballs_to_hdfs(format("/usr/hdp/{hdp_version}/hadoop/mapreduce.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ hdp_stack_version }}/mapreduce/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) - copy_tarballs_to_hdfs(format("/usr/hdp/{hdp_version}/tez/lib/tez.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ hdp_stack_version }}/tez/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) - copy_tarballs_to_hdfs(format("/usr/hdp/{hdp_version}/hive/hive.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ hdp_stack_version }}/hive/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) - copy_tarballs_to_hdfs(format("/usr/hdp/{hdp_version}/pig/pig.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ hdp_stack_version }}/pig/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) - copy_tarballs_to_hdfs(format("/usr/hdp/{hdp_version}/hadoop-mapreduce/hadoop-streaming.jar"), hdfs_path_prefix+"/hdp/apps/{{ hdp_stack_version }}/mapreduce/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) - copy_tarballs_to_hdfs(format("/usr/hdp/{hdp_version}/sqoop/sqoop.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ hdp_stack_version }}/sqoop/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) + copy_tarballs_to_hdfs(format("/usr/hdp/{stack_version}/hadoop/mapreduce.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ stack_version_formatted }}/mapreduce/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) + copy_tarballs_to_hdfs(format("/usr/hdp/{stack_version}/tez/lib/tez.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ stack_version_formatted }}/tez/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) + copy_tarballs_to_hdfs(format("/usr/hdp/{stack_version}/hive/hive.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ stack_version_formatted }}/hive/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) + copy_tarballs_to_hdfs(format("/usr/hdp/{stack_version}/pig/pig.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ stack_version_formatted }}/pig/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) + copy_tarballs_to_hdfs(format("/usr/hdp/{stack_version}/hadoop-mapreduce/hadoop-streaming.jar"), hdfs_path_prefix+"/hdp/apps/{{ stack_version_formatted }}/mapreduce/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) + copy_tarballs_to_hdfs(format("/usr/hdp/{stack_version}/sqoop/sqoop.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ stack_version_formatted }}/sqoop/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) print "Creating hdfs directories..." createHdfsResources() putSQLDriverToOozieShared() http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/package/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/package/scripts/params.py index c22349f..1159491 100644 --- a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/package/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/package/scripts/params.py @@ -30,7 +30,7 @@ tmp_dir = Script.get_tmp_dir() rpm_version = default("/configurations/cluster-env/rpm_version", None) stack_version_unformatted = str(config['hostLevelParams']['stack_version']) -hdp_stack_version = config['hostLevelParams']['stack_version'] +stack_version_formatted = config['hostLevelParams']['stack_version'] #hadoop params if rpm_version: @@ -62,7 +62,7 @@ else: hive_tar_file = '/usr/share/HDP-webhcat/hive.tar.gz' sqoop_tar_file = '/usr/share/HDP-webhcat/sqoop*.tar.gz' - if str(hdp_stack_version).startswith('2.0'): + if str(stack_version_formatted).startswith('2.0'): hcat_lib = '/usr/lib/hcatalog/share/hcatalog' webhcat_bin_dir = '/usr/lib/hcatalog/sbin' # for newer versions @@ -262,7 +262,7 @@ webhcat_hdfs_user_mode = 0755 #for create_hdfs_directory security_param = "true" if security_enabled else "false" -if str(hdp_stack_version).startswith('2.0') or str(hdp_stack_version).startswith('2.1'): +if str(stack_version_formatted).startswith('2.0') or str(stack_version_formatted).startswith('2.1'): app_dir_files = {tez_local_api_jars:None} else: app_dir_files = { http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py index 68fe9f9..ab7dea5 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py @@ -21,9 +21,9 @@ from ambari_commons.constants import AMBARI_SUDO_BINARY from resource_management.libraries.script import Script from resource_management.libraries.functions import default from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions import format_jvm_option -from resource_management.libraries.functions.version import format_hdp_stack_version +from resource_management.libraries.functions.version import format_stack_version config = Script.get_config() @@ -32,18 +32,18 @@ dfs_type = default("/commandParams/dfs_type", "") sudo = AMBARI_SUDO_BINARY stack_version_unformatted = str(config['hostLevelParams']['stack_version']) -hdp_stack_version = format_hdp_stack_version(stack_version_unformatted) +stack_version_formatted = format_stack_version(stack_version_unformatted) # current host stack version current_version = default("/hostLevelParams/current_version", None) # default hadoop params mapreduce_libs_path = "/usr/lib/hadoop-mapreduce/*" -hadoop_libexec_dir = hdp_select.get_hadoop_dir("libexec") +hadoop_libexec_dir = stack_select.get_hadoop_dir("libexec") hadoop_conf_empty_dir = "/etc/hadoop/conf.empty" # HDP 2.2+ params -if Script.is_hdp_stack_greater_or_equal("2.2"): +if Script.is_stack_greater_or_equal("2.2"): mapreduce_libs_path = "/usr/hdp/current/hadoop-mapreduce-client/*" # not supported in HDP 2.2+ http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py index b957bd0..8cf75cb 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py @@ -21,7 +21,7 @@ import os import ambari_simplejson as json from resource_management.core.logger import Logger from resource_management.libraries.functions import conf_select -from resource_management.libraries.functions import hdp_select +from resource_management.libraries.functions import stack_select from resource_management.libraries.functions.format import format from resource_management.libraries.functions.version import compare_versions from resource_management.libraries.resources.xml_config import XmlConfig @@ -37,11 +37,11 @@ def setup_hdp_symlinks(): :return: """ import params - if params.hdp_stack_version != "" and compare_versions(params.hdp_stack_version, '2.2') >= 0: + if params.stack_version_formatted != "" and compare_versions(params.stack_version_formatted, '2.2') >= 0: # try using the exact version first, falling back in just the stack if it's not defined # which would only be during an intial cluster installation version = params.current_version if params.current_version is not None else params.stack_version_unformatted - hdp_select.select_all(version) + stack_select.select_all(version) def setup_config(): @@ -87,7 +87,7 @@ def link_configs(struct_out_file): Links configs, only on a fresh install of HDP-2.3 and higher """ - if not Script.is_hdp_stack_greater_or_equal("2.3"): + if not Script.is_stack_greater_or_equal("2.3"): Logger.info("Can only link configs for HDP-2.3 and higher.") return