]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
qa/tasks/ceph.py: quote "<kind>" in command line
authorKefu Chai <kchai@redhat.com>
Fri, 6 Mar 2020 04:17:40 +0000 (12:17 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 6 Mar 2020 04:17:42 +0000 (12:17 +0800)
commitda736c22c5ac39f3b45018f6a9a52cc469e504d5
tree3cb6a7cee58603d6379ba6c87c93c5db8bb2488d
parent77425b3c4abb4e663dae59c3b72684200f4eb77c
qa/tasks/ceph.py: quote "<kind>" in command line

otherwise bash will intepret "kind" as a file when handling command like
```
sudo zgrep <kind> /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 "<kind>" as an argument to zgrep, along with
the globbed files names which matches "/var/log/ceph/valgrind/*".

in this change, "<kind>" 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 <kchai@redhat.com>
qa/tasks/ceph.py