Repository: ambari Updated Branches: refs/heads/branch-2.1 a6c325376 -> 4a9a2bce7 refs/heads/trunk 82c5c6a18 -> 0498d9351
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/0498d935 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0498d935 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0498d935 Branch: refs/heads/trunk Commit: 0498d9351cdc1a67d05edcbf8e8299244d3415d6 Parents: 82c5c6a Author: Andrew Onishuk <aonis...@hortonworks.com> Authored: Wed Jul 1 19:45:24 2015 +0300 Committer: Andrew Onishuk <aonis...@hortonworks.com> Committed: Wed Jul 1 19:45:24 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/0498d935/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)):