FIX: Coredump packing combination 51/17551/2
authorPeter Mikus <pmikus@cisco.com>
Wed, 13 Feb 2019 09:02:02 +0000 (09:02 +0000)
committerPeter Mikus <pmikus@cisco.com>
Wed, 13 Feb 2019 09:03:59 +0000 (09:03 +0000)
- Remove DIR

Change-Id: Iba1b03d407e93d4e60fb49f6b50747de87f82ac7
Signed-off-by: Peter Mikus <pmikus@cisco.com>
resources/libraries/python/CoreDumpUtil.py

index 7843a59..ea79124 100644 (file)
@@ -132,11 +132,12 @@ class CoreDumpUtil(object):
             uuid = str(time()).replace('.', '')
             name = '{uuid}.tar.lzo.lrz.xz'.format(uuid=uuid)
 
-            command = ('[ -e {dir}/*.core ] && sudo tar c {dir}/*.core | '
+            command = ('[ -e {dir}/*.core ] && cd {dir} && '
+                       'sudo tar c *.core | '
                        'lzop -1 | '
                        'lrzip -n -T -p 1 -w 5 | '
-                       'xz -9e > {dir}/{name} && '
-                       'sudo rm -f {dir}/*.core'
+                       'xz -9e > {name} && '
+                       'sudo rm -f *.core'
                        .format(dir=Constants.CORE_DUMP_DIR, name=name))
             try:
                 exec_cmd_no_error(node, command, timeout=3600)

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.