From 7b942766c1f78f155aab5ab90ad1e85e13d5f204 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 6 Mar 2020 12:17:40 +0800 Subject: [PATCH] qa/tasks/ceph.py: quote "" in command line otherwise bash will intepret "kind" as a file when handling command like ``` sudo zgrep /var/log/ceph/valgrind/* /dev/null | sort | uniq ``` and try to feed its content to zgrep, and write the output of zgrep to /var/log/ceph/valgrind/*. this is not the intended behavior. what we what to do is to pass "" as an argument to zgrep, along with the globbed files names which matches "/var/log/ceph/valgrind/*". in this change, "" is quoted as in the command line. it's also what `pipes.quote()` does before the change of 35cf5131e7152ce20d916aa99c124751d6a97f5c. this addresses the regression introduced by 35cf5131e7152ce20d916aa99c124751d6a97f5c. Fixes: https://tracker.ceph.com/issues/44454 Signed-off-by: Kefu Chai (cherry picked from commit da736c22c5ac39f3b45018f6a9a52cc469e504d5) --- qa/tasks/ceph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 791787865ac69..f2380e61a48de 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -313,10 +313,10 @@ def valgrind_post(ctx, config): for remote in ctx.cluster.remotes.keys(): # look at valgrind logs for each node proc = remote.run( - args='sudo zgrep /var/log/ceph/valgrind/* ' + args="sudo zgrep '' /var/log/ceph/valgrind/* " # include a second file so that we always get # a filename prefix on the output - '/dev/null | sort | uniq', + "/dev/null | sort | uniq", wait=False, check_status=False, stdout=BytesIO(), -- 2.39.5