Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 066CC200B81 for ; Tue, 30 Aug 2016 04:36:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 05217160AB8; Tue, 30 Aug 2016 02:36:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EF69A160AD0 for ; Tue, 30 Aug 2016 04:36:09 +0200 (CEST) Received: (qmail 63240 invoked by uid 500); 30 Aug 2016 02:36:09 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 62981 invoked by uid 99); 30 Aug 2016 02:36:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2016 02:36:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C6AA0E1075; Tue, 30 Aug 2016 02:36:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smohanty@apache.org To: commits@ambari.apache.org Date: Tue, 30 Aug 2016 02:36:16 -0000 Message-Id: <55cceaaedc464d2597294c5d4d3dcc2e@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [09/16] ambari git commit: AMBARI-18239: oozie.py is reading invalid 'version' attribute which results in not copying required atlas hook jars (jluniya) archived-at: Tue, 30 Aug 2016 02:36:11 -0000 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/1fda3d87 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1fda3d87 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1fda3d87 Branch: refs/heads/branch-2.5 Commit: 1fda3d8737a4ef069dae8d71555579a71c5b54ea Parents: 905f063 Author: Jayush Luniya Authored: Tue Aug 23 17:23:38 2016 -0700 Committer: Sumit Mohanty Committed: Mon Aug 29 18:31:25 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/1fda3d87/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/1fda3d87/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}"))