ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-15171: Parameterize distro-specific stack information for SLIDER (Juanjo Marron via dili)
Date Mon, 29 Feb 2016 15:36:36 GMT
Repository: ambari
Updated Branches:
  refs/heads/AMBARI-13364 f83a07e36 -> ec88341d1


AMBARI-15171: Parameterize distro-specific stack information for SLIDER (Juanjo Marron via
dili)


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

Branch: refs/heads/AMBARI-13364
Commit: ec88341d12042241afcbef6ef320c7a5790ec9b7
Parents: f83a07e
Author: Di Li <dili@apache.org>
Authored: Mon Feb 29 10:36:01 2016 -0500
Committer: Di Li <dili@apache.org>
Committed: Mon Feb 29 10:36:01 2016 -0500

----------------------------------------------------------------------
 .../SLIDER/0.60.0.2.2/package/scripts/params.py             | 2 +-
 .../SLIDER/0.60.0.2.2/package/scripts/params_linux.py       | 9 ++++++---
 .../SLIDER/0.60.0.2.2/package/scripts/params_windows.py     | 4 ++--
 .../SLIDER/0.60.0.2.2/package/scripts/service_check.py      | 4 ++--
 .../SLIDER/0.60.0.2.2/package/scripts/slider.py             | 2 +-
 .../SLIDER/0.60.0.2.2/package/scripts/slider_client.py      | 5 +++--
 6 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ec88341d/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
index 7b6a490..bb16dc3 100644
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
@@ -41,7 +41,7 @@ stack_name = default("/hostLevelParams/stack_name", None)
 version = default("/commandParams/version", None)
 
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
+stack_version_formatted = format_hdp_stack_version(stack_version_unformatted)
 
 #hadoop params
 hadoop_conf_dir = conf_select.get_hadoop_conf_dir()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec88341d/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
index 09b7876..0b6b3a9 100644
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
@@ -27,15 +27,18 @@ from resource_management.libraries.functions import get_kinit_path
 # server configurations
 config = Script.get_config()
 
-slider_home_dir = '/usr/hdp/current/slider-client'
+stack_dir = config['configurations']['cluster-env']['stack_dir']
+stack_version_ru_support = config['configurations']['cluster-env']['stack_version_ru_support']
+
+slider_home_dir = format('{stack_dir}/current/slider-client')
 
 #hadoop params
 slider_bin_dir = "/usr/lib/slider/bin"
-if Script.is_hdp_stack_greater_or_equal("2.2"):
+if Script.is_hdp_stack_greater_or_equal(stack_version_ru_support):
     slider_bin_dir = format('{slider_home_dir}/bin')
 
 slider_conf_dir = format("{slider_home_dir}/conf")
-storm_slider_conf_dir = '/usr/hdp/current/storm-slider-client/conf'
+storm_slider_conf_dir = format('{stack_dir}/current/storm-slider-client/conf')
 
 slider_lib_dir = format('{slider_home_dir}/lib')
 slider_tar_gz = format('{slider_lib_dir}/slider.tar.gz')

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec88341d/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
index 366a1c9..fdb8160 100644
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
@@ -24,13 +24,13 @@ import os
 # server configurations
 config = Script.get_config()
 
-hdp_root = None
+stack_root = None
 slider_home = None
 slider_bin_dir = None
 slider_conf_dir = None
 storm_slider_conf_dir = None
 try:
-  hdp_root = os.path.abspath(os.path.join(os.environ["HADOOP_HOME"],".."))
+  stack_root = os.path.abspath(os.path.join(os.environ["HADOOP_HOME"],".."))
   slider_home = os.environ['SLIDER_HOME']
   slider_bin_dir = os.path.join(slider_home, 'bin')
   slider_conf_dir = os.path.join(slider_home, 'conf')

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec88341d/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py
index 1aed032..7563e00 100644
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/service_check.py
@@ -29,7 +29,7 @@ class SliderServiceCheck(Script):
   def service_check(self, env):
     import params
     env.set_params(params)
-    smoke_cmd = os.path.join(params.hdp_root, "Run-SmokeTests.cmd")
+    smoke_cmd = os.path.join(params.stack_root, "Run-SmokeTests.cmd")
     service = "SLIDER"
     Execute(format("cmd /C {smoke_cmd} {service}"), logoutput=True, user=params.hdfs_user)
 
@@ -38,7 +38,7 @@ class SliderServiceCheck(Script):
     import params
     env.set_params(params)
     
-    if Script.is_hdp_stack_greater_or_equal("2.2"):
+    if Script.is_hdp_stack_greater_or_equal(params.stack_version_ru_support):
       copy_to_hdfs("slider", params.user_group, params.hdfs_user, host_sys_prepped=params.host_sys_prepped)
     
     smokeuser_kinit_cmd = format(

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec88341d/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py
index b487259..e19f961 100644
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py
@@ -81,7 +81,7 @@ def slider():
     File(format("{params.slider_conf_dir}/log4j.properties"),
          mode=0644
     )
-  if Script.is_hdp_stack_greater_or_equal("2.2"): 
+  if Script.is_hdp_stack_greater_or_equal(params.stack_version_ru_support):
     File(params.slider_tar_gz,
          owner=params.hdfs_user,
          group=params.user_group,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec88341d/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
index 5865048..55505a2 100644
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider_client.py
@@ -32,13 +32,14 @@ class SliderClient(Script):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class SliderClientLinux(SliderClient):
   def get_stack_to_component(self):
-    return {"HDP": "slider-client"}
+    import params
+    return {params.stack_name: "slider-client"}
 
   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_hdp_stack_version(params.version), params.stack_version_ru_support)
>= 0:
       conf_select.select(params.stack_name, "slider", params.version)
       hdp_select.select("slider-client", params.version)
 


Mime
View raw message