You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by kr...@apache.org on 2018/07/24 14:40:53 UTC

[ambari] branch trunk updated: AMBARI-24332 - PERF 1.0 package not installed in the cluster at deploy time (#1844)

This is an automated email from the ASF dual-hosted git repository.

krisztiankasa pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 123208d  AMBARI-24332 - PERF 1.0 package not installed in the cluster at deploy time (#1844)
123208d is described below

commit 123208dae29ee8bb1e6f5220f102527660f6a022
Author: kasakrisz <33...@users.noreply.github.com>
AuthorDate: Tue Jul 24 16:40:49 2018 +0200

    AMBARI-24332 - PERF 1.0 package not installed in the cluster at deploy time (#1844)
---
 .../PERF/1.0/hooks/before-INSTALL/scripts/distro-select.py     | 10 +++++++++-
 .../stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py       |  7 +++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/distro-select.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/distro-select.py
index 6d9a814..cf8d869 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/distro-select.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/distro-select.py
@@ -17,8 +17,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 """
 
-import sys
 import os
+import sys
 
 AMBARI_AGENT_HOST_DIR = "AMBARI_AGENT_HOST_DIR"
 
@@ -125,6 +125,12 @@ def install_version(args):
       if args[1]:
         f.write(args[1] + "\n")
 
+def deploy_cluster(args):
+  dest = versions_file_destination()
+  with open(dest, 'w') as f:
+    if args[1]:
+      f.write(args[1] + "\n")
+
 def do_work(args):
   """
   Check that all required args are passed in. If so, perform required action.
@@ -138,6 +144,8 @@ def do_work(args):
     set_version(args)
   elif args[0] == "install":
     install_version(args)
+  elif args[0] == "deploy_cluster":
+    deploy_cluster(args)
 
 
 
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
index 513b994..d1a3b2f 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-INSTALL/scripts/hook.py
@@ -17,9 +17,10 @@ limitations under the License.
 
 """
 import os
-
 from resource_management import ExecutionFailed
-from resource_management.core.resources.system import Directory, File, Execute
+from resource_management.core.resources.system import Execute
+from resource_management.core.shell import call
+from resource_management.libraries.functions.default import default
 from resource_management.libraries.script import Hook
 
 AMBARI_AGENT_CACHE_DIR = 'AMBARI_AGENT_CACHE_DIR'
@@ -56,6 +57,8 @@ class BeforeInstallHook(Hook):
     try:
       Execute("cp -n %s %s" % (dist_select, DISTRO_SELECT_DEST), user="root")
       Execute("chmod a+x %s" % (DISTRO_SELECT_DEST), user="root")
+      stack_version_unformatted = str(default("/clusterLevelParams/stack_version", ""))
+      call((DISTRO_SELECT_DEST, 'deploy_cluster', stack_version_unformatted))
     except ExecutionFailed:
       pass   # Due to concurrent execution, may produce error