You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2015/04/17 21:19:00 UTC

ambari git commit: AMBARI-10575. RU: Oozie upgrade fails when using oracle DB (dlysnichenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 672eee34d -> 8f253dfd3


AMBARI-10575. RU: Oozie upgrade fails when using oracle DB (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 8f253dfd366b0bef41d2cace978363e61e410796
Parents: 672eee3
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Fri Apr 17 22:18:00 2015 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Fri Apr 17 22:18:30 2015 +0300

----------------------------------------------------------------------
 .../package/scripts/oozie_server_upgrade.py     | 22 +++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8f253dfd/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
index a14934b..c4a62ea 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
@@ -30,6 +30,8 @@ from resource_management.libraries.functions import Direction
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions import compare_versions
 from resource_management.libraries.functions import format_hdp_stack_version
+from resource_management.core.resources import File
+from resource_management.core.source import DownloadSource
 
 BACKUP_TEMP_DIR = "oozie-upgrade-backup"
 BACKUP_CONF_ARCHIVE = "oozie-conf-backup.tar"
@@ -100,7 +102,7 @@ def prepare_libext_directory():
   """
   Creates /usr/hdp/current/oozie/libext-customer and recursively sets
   777 permissions on it and its parents.
-  :return:
+  Also, downloads jdbc driver and provides other staff
   """
   import params
 
@@ -151,6 +153,24 @@ def prepare_libext_directory():
   Logger.info("Copying {0} to {1}".format(oozie_ext_zip_file, params.oozie_libext_customer_dir))
   shutil.copy2(oozie_ext_zip_file, params.oozie_libext_customer_dir)
 
+  # Redownload jdbc driver to a new current location
+  if params.jdbc_driver_name=="com.mysql.jdbc.Driver" or \
+                  params.jdbc_driver_name == "com.microsoft.sqlserver.jdbc.SQLServerDriver" or \
+                  params.jdbc_driver_name=="oracle.jdbc.driver.OracleDriver":
+    File(params.downloaded_custom_connector,
+         content = DownloadSource(params.driver_curl_source),
+    )
+
+    Execute(('cp', '--remove-destination', params.downloaded_custom_connector, params.target),
+            #creates=params.target, TODO: uncomment after ranger_hive_plugin will not provide jdbc
+            path=["/bin", "/usr/bin/"],
+            sudo = True)
+
+    File ( params.target,
+           owner = params.oozie_user,
+           group = params.user_group
+    )
+
 
 def upgrade_oozie():
   """