You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by am...@apache.org on 2017/11/16 15:37:12 UTC

[49/50] [abbrv] ambari git commit: AMBARI-22444 - Add Native Libraries To Tez Tarball (part2) (jonathanhurley)

AMBARI-22444 - Add Native Libraries To Tez Tarball (part2) (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 69bb45f7586c41479d90d286c70a3f54a87d53eb
Parents: 7c6ca64
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Wed Nov 15 17:37:57 2017 -0500
Committer: Attila Magyar <am...@hortonworks.com>
Committed: Thu Nov 16 16:35:32 2017 +0100

----------------------------------------------------------------------
 .../libraries/functions/copy_tarball.py                   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/69bb45f7/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
index f62aa3d..7bca967 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
@@ -33,6 +33,7 @@ from resource_management.core import shell
 from resource_management.core import sudo
 from resource_management.core.logger import Logger
 from resource_management.core.exceptions import Fail
+from resource_management.core.resources.system import Directory
 from resource_management.core.resources.system import Execute
 from resource_management.libraries.functions import stack_tools, stack_features, stack_select
 from resource_management.libraries.functions import tar_archive
@@ -77,7 +78,14 @@ def _prepare_tez_tarball():
 
   Execute(("cp", "-a", hadoop_lib_native_dir, tez_lib_dir), sudo = True)
 
-  tez_tarball_with_native_lib = os.path.join(os.path.dirname(tez_source_file), "tez-native.tar.gz")
+  tez_native_tarball_staging_dir = os.path.join(temp_dir, "tez-native-tarball-staging")
+  if not os.path.exists(tez_native_tarball_staging_dir):
+    Directory(tez_native_tarball_staging_dir,
+      cd_access='a',
+      create_parents = True,
+      recursive_ownership = True)
+
+  tez_tarball_with_native_lib = os.path.join(tez_native_tarball_staging_dir, "tez-native.tar.gz")
   Logger.info("Creating a new Tez tarball at {0}".format(tez_tarball_with_native_lib))
 
   # tar up Tez, making sure to specify nothing for the arcname so that it does not include an absolute path