This is an automated email from the ASF dual-hosted git repository. krisztiankasa pushed a commit to branch branch-2.7 in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push: new c26bd81 AMBARI-24332 - PERF 1.0 package not installed in the cluster at deploy time (#1861) c26bd81 is described below commit c26bd81eb516e6fecbfeddeea2899e18da0dae98 Author: kasakrisz <33458261+kasakr...@users.noreply.github.com> AuthorDate: Wed Jul 25 07:56:22 2018 +0200 AMBARI-24332 - PERF 1.0 package not installed in the cluster at deploy time (#1861) --- .../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