AMBARI-15092. Oozie sharelib missing SQL JDBC driver (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/494d9d78 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/494d9d78 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/494d9d78 Branch: refs/heads/branch-2.2 Commit: 494d9d78bcc2078f517953d066c5ef926fdcb106 Parents: ad5ecf8 Author: Andrew Onishuk <aonis...@hortonworks.com> Authored: Thu Feb 18 19:43:16 2016 +0200 Committer: Andrew Onishuk <aonis...@hortonworks.com> Committed: Thu Feb 18 19:43:16 2016 +0200 ---------------------------------------------------------------------- ambari-server/src/main/resources/scripts/Ambaripreupload.py | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/494d9d78/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 a803de4..cc6213e 100644 --- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py +++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py @@ -43,6 +43,8 @@ from resource_management.libraries.functions.format import format from resource_management.libraries.resources.hdfs_resource import HdfsResource from resource_management.libraries.resources.execute_hadoop import ExecuteHadoop from resource_management import Script + +SQL_DRIVER_PATH = "/var/lib/ambari-server/resources/sqljdbc41.jar" """ This file provides helper methods needed for the versioning of RPMs. Specifically, it does dynamic variable @@ -266,6 +268,10 @@ with Environment() as env: with open("/var/lib/ambari-agent/data/.hdfs_resource_ignore", "a+") as fp: fp.write(file_content) + def putSQLDriverToOozieShared(): + params.HdfsResource('/user/oozie/share/lib/sqoop/{0}'.format(os.path.basename(SQL_DRIVER_PATH)), + owner='hdfs', type='file', action=['create_on_execute'], mode=0644, source=SQL_DRIVER_PATH) + env.set_params(params) hadoop_conf_dir = params.hadoop_conf_dir @@ -374,6 +380,7 @@ with Environment() as env: copy_tarballs_to_hdfs(format("/usr/hdp/{hdp_version}/sqoop/sqoop.tar.gz"), hdfs_path_prefix+"/hdp/apps/{{ hdp_stack_version }}/sqoop/", 'hadoop-mapreduce-historyserver', params.mapred_user, params.hdfs_user, params.user_group) print "Creating hdfs directories..." createHdfsResources() + putSQLDriverToOozieShared() putCreatedHdfsResourcesToIgnore(env) # jar shouldn't be used before (read comment below)