You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2016/02/10 17:13:04 UTC
[07/24] ambari git commit: AMBARI-14949: Ambaripreupload should skip
uploading oozie shared lib for upgrade (jluniya)
AMBARI-14949: Ambaripreupload should skip uploading oozie shared lib for upgrade (jluniya)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/53526383
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/53526383
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/53526383
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 53526383411f4709a6a59befeee8e68c7420cdc5
Parents: e76099a
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Mon Feb 8 14:36:00 2016 -0800
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Mon Feb 8 14:36:00 2016 -0800
----------------------------------------------------------------------
.../main/resources/scripts/Ambaripreupload.py | 31 ++++++++++++--------
1 file changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/53526383/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 591b7d2..5a20698 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -85,8 +85,10 @@ with Environment() as env:
parser = OptionParser()
parser.add_option("-v", "--hdp-version", dest="hdp_version", default="",
help="hdp-version used in path of tarballs")
-
+ parser.add_option("-u", "--upgrade", dest="upgrade", action="store_true",
+ help="flag to indicate script is being run for upgrade", default=False)
(options, args) = parser.parse_args()
+
# See if hdfs path prefix is provided on the command line. If yes, use that value, if no
# use empty string as default.
@@ -273,19 +275,22 @@ with Environment() as env:
oozie_hdfs_user_dir = format("{hdfs_path_prefix}/user/{oozie_user}")
kinit_if_needed = ''
- params.HdfsResource(format("{oozie_hdfs_user_dir}/share/"),
- action="delete_on_execute",
- type = 'directory'
- )
+ if options.upgrade:
+ Logger.info("Skipping uploading oozie shared lib during upgrade")
+ else:
+ params.HdfsResource(format("{oozie_hdfs_user_dir}/share/"),
+ action="delete_on_execute",
+ type = 'directory'
+ )
- params.HdfsResource(format("{oozie_hdfs_user_dir}/share"),
- action="create_on_execute",
- type = 'directory',
- mode=0755,
- recursive_chmod = True,
- owner=oozie_user,
- source = oozie_shared_lib,
- )
+ params.HdfsResource(format("{oozie_hdfs_user_dir}/share"),
+ action="create_on_execute",
+ type = 'directory',
+ mode=0755,
+ recursive_chmod = True,
+ owner=oozie_user,
+ source = oozie_shared_lib,
+ )
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)