Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E8F0218FA2 for ; Wed, 1 Jul 2015 16:45:34 +0000 (UTC) Received: (qmail 44395 invoked by uid 500); 1 Jul 2015 16:45:34 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 44360 invoked by uid 500); 1 Jul 2015 16:45:34 -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 44345 invoked by uid 99); 1 Jul 2015 16:45:34 -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; Wed, 01 Jul 2015 16:45:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A7E98E0419; Wed, 1 Jul 2015 16:45:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aonishuk@apache.org To: commits@ambari.apache.org Date: Wed, 01 Jul 2015 16:45:35 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] ambari git commit: AMBARI-12240. with non-root agent RU Flume restart fails (aonishuk) AMBARI-12240. with non-root agent RU Flume restart fails (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4a9a2bce Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4a9a2bce Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4a9a2bce Branch: refs/heads/branch-2.1 Commit: 4a9a2bce773532e3947b728d5e70b3c6b5e34802 Parents: a6c3253 Author: Andrew Onishuk Authored: Wed Jul 1 19:45:26 2015 +0300 Committer: Andrew Onishuk Committed: Wed Jul 1 19:45:26 2015 +0300 ---------------------------------------------------------------------- .../FLUME/1.4.0.2.0/package/scripts/flume_upgrade.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4a9a2bce/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_upgrade.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_upgrade.py b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_upgrade.py index 265bf5e..32cc1b9 100644 --- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_upgrade.py +++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/flume_upgrade.py @@ -23,6 +23,7 @@ import tempfile from resource_management.core.logger import Logger from resource_management.core.exceptions import Fail +from resource_management.core.resources.system import Execute from resource_management.libraries.functions import tar_archive BACKUP_TEMP_DIR = "flume-upgrade-backup" @@ -70,13 +71,9 @@ def pre_start_restore(): if os.path.isfile(archive): Logger.info('Extracting {0} to {1}'.format(archive, directory)) - tarball = None - try: - tarball = tarfile.open(archive, "r") - tarball.extractall(directory) - finally: - if tarball: - tarball.close() + Execute(('tar','-xvf',archive,'-C',directory+"/"), + sudo = True, + ) # cleanup if os.path.exists(os.path.join(tempfile.gettempdir(), BACKUP_TEMP_DIR)):