Repository: impala
Updated Branches:
  refs/heads/2.x 3bfee642d -> 381f50ad0


Fix diagnostics path to not include the parent dir structure

Without the fix, the diagnostics tar file included the entire
directory structure of the diagnostics root dir.

Before:
=======
$ tar tf /tmp/impala-diagnostics-2018-05-08-11-59-39-spv8Eh.tar.gz
tmp/impala-diagnostics-2018-05-08-11-59-39-spv8Eh/
tmp/impala-diagnostics-2018-05-08-11-59-39-spv8Eh/stacks/
tmp/impala-diagnostics-2018-05-08-11-59-39-spv8Eh/stacks/jstack-0.txt
....

After:
=====
$ tar tf /tmp/impala-diagnostics-2018-05-08-12-01-51-Y0nlQI.tar.gz
impala-diagnostics-2018-05-08-12-01-51-Y0nlQI/
impala-diagnostics-2018-05-08-12-01-51-Y0nlQI/stacks/
impala-diagnostics-2018-05-08-12-01-51-Y0nlQI/stacks/jstack-0.txt
.....

Tested with python 2.6

Change-Id: I540f6c228a0315780d45cf11961f124478b5dd0c
Reviewed-on: http://gerrit.cloudera.org:8080/10347
Reviewed-by: Bharath Vissapragada <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


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

Branch: refs/heads/2.x
Commit: bbf96dca1a6ab9ad67f4b2e4481459689e77fe75
Parents: 3bfee64
Author: Bharath Vissapragada <[email protected]>
Authored: Tue May 8 12:03:35 2018 -0700
Committer: Impala Public Jenkins <[email protected]>
Committed: Thu May 10 21:49:24 2018 +0000

----------------------------------------------------------------------
 bin/diagnostics/collect_diagnostics.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/bbf96dca/bin/diagnostics/collect_diagnostics.py
----------------------------------------------------------------------
diff --git a/bin/diagnostics/collect_diagnostics.py 
b/bin/diagnostics/collect_diagnostics.py
index 8fe4561..56b5595 100644
--- a/bin/diagnostics/collect_diagnostics.py
+++ b/bin/diagnostics/collect_diagnostics.py
@@ -447,7 +447,10 @@ class ImpalaDiagnosticsHandler(object):
       # around that.
       with closing(tarfile.open(self.collection_root_dir + '.tar.gz', 
mode='w:gz')) as\
           archive:
-        archive.add(self.collection_root_dir)
+        # collection_root_dir is an absoulte path. There is no point in 
preserving its
+        # entire directory structure in the archive, so set the arcname 
accordingly.
+        archive.add(self.collection_root_dir,
+            arcname=os.path.basename(self.collection_root_dir))
       return True
     except Exception:
       logging.exception("Encountered an exception archiving diagnostics, 
cleaning up.")

Reply via email to