ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From magyari_san...@apache.org
Subject [28/50] ambari git commit: AMBARI-18239: oozie.py is reading invalid 'version' attribute which results in not copying required atlas hook jars (jluniya)
Date Mon, 12 Sep 2016 11:53:52 GMT
AMBARI-18239: oozie.py is reading invalid 'version' attribute which results in not copying
required atlas hook jars (jluniya)


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

Branch: refs/heads/AMBARI-2.4.0.2
Commit: 5516d305384679508eaee87399d042272394e394
Parents: f4250b4
Author: Jayush Luniya <jluniya@hortonworks.com>
Authored: Tue Aug 23 17:26:02 2016 -0700
Committer: Jayush Luniya <jluniya@hortonworks.com>
Committed: Tue Aug 23 17:26:02 2016 -0700

----------------------------------------------------------------------
 .../resource_management/libraries/functions/copy_tarball.py  | 4 ++--
 .../common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py | 8 +++++---
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5516d305/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 ac4e5b8..2626990 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
@@ -80,7 +80,7 @@ def get_tarball_paths(name, use_upgrading_version_during_upgrade=True, custom_so
     Logger.error("Cannot copy {0} tarball to HDFS because stack name could not be determined.".format(str(name)))
     return (False, None, None)
 
-  stack_version = _get_current_version(use_upgrading_version_during_upgrade)
+  stack_version = get_current_version(use_upgrading_version_during_upgrade)
   if not stack_version:
     Logger.error("Cannot copy {0} tarball to HDFS because stack version could be be determined.".format(str(name)))
     return (False, None, None)
@@ -113,7 +113,7 @@ def get_tarball_paths(name, use_upgrading_version_during_upgrade=True,
custom_so
   return (True, source_file, dest_file)
 
 
-def _get_current_version(use_upgrading_version_during_upgrade=True):
+def get_current_version(use_upgrading_version_during_upgrade=True):
   """
   Get the effective version to use to copy the tarballs to.
   :param use_upgrading_version_during_upgrade: True, except when the RU/EU hasn't started
yet.

http://git-wip-us.apache.org/repos/asf/ambari/blob/5516d305/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
index 0736ae9..80eda3e 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
@@ -33,6 +33,7 @@ from resource_management.libraries.functions import StackFeature
 from resource_management.libraries.functions.version import format_stack_version
 from resource_management.libraries.functions.stack_features import check_stack_feature
 from resource_management.libraries.functions.oozie_prepare_war import prepare_war
+from resource_management.libraries.functions.copy_tarball import get_current_version
 from resource_management.libraries.resources.xml_config import XmlConfig
 from resource_management.libraries.script.script import Script
 from resource_management.core.resources.packaging import Package
@@ -307,7 +308,7 @@ def oozie_server_specific():
     )
 
     # If Atlas is also installed, need to generate Atlas Hive hook (hive-atlas-application.properties
file) in directory
-    # {stack_root}/{version}/atlas/hook/hive/
+    # {stack_root}/{current_version}/atlas/hook/hive/
     # Because this is a .properties file instead of an xml file, it will not be read automatically
by Oozie.
     # However, should still save the file on this host so that can upload it to the Oozie
Sharelib in DFS.
     if has_atlas_in_cluster():
@@ -346,7 +347,7 @@ def copy_atlas_hive_hook_to_dfs_share_lib(upgrade_type=None, upgrade_direction=N
   """
    If the Atlas Hive Hook direcotry is present, Atlas is installed, and this is the first
Oozie Server,
   then copy the entire contents of that directory to the Oozie Sharelib in DFS, e.g.,
-  /usr/$stack/$version/atlas/hook/hive/ -> hdfs:///user/oozie/share/lib/lib_$timetamp/hive
+  /usr/$stack/$current_version/atlas/hook/hive/ -> hdfs:///user/oozie/share/lib/lib_$timetamp/hive
 
   :param upgrade_type: If in the middle of a stack upgrade, the type as UPGRADE_TYPE_ROLLING
or UPGRADE_TYPE_NON_ROLLING
   :param upgrade_direction: If in the middle of a stack upgrade, the direction as Direction.UPGRADE
or Direction.DOWNGRADE.
@@ -373,7 +374,8 @@ def copy_atlas_hive_hook_to_dfs_share_lib(upgrade_type=None, upgrade_direction=N
                  "and performing a Downgrade.")
     return
 
-  atlas_hive_hook_dir = format("{stack_root}/{version}/atlas/hook/hive/")
+  current_version = get_current_version()
+  atlas_hive_hook_dir = format("{stack_root}/{current_version}/atlas/hook/hive/")
   if not os.path.exists(atlas_hive_hook_dir):
     Logger.error(format("ERROR. Atlas is installed in cluster but this Oozie server doesn't
"
                         "contain directory {atlas_hive_hook_dir}"))


Mime
View raw message