ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [2/2] ambari git commit: AMBARI-12240. with non-root agent RU Flume restart fails (aonishuk)
Date Wed, 01 Jul 2015 16:45:35 GMT
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 <aonishuk@hortonworks.com>
Authored: Wed Jul 1 19:45:26 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
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)):


Mime
View raw message