qa/tasks/ceph: create a log file before redirecting to it
authorKefu Chai <kchai@redhat.com>
Fri, 21 Aug 2020 12:22:23 +0000 (20:22 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 22 Aug 2020 03:33:12 +0000 (11:33 +0800)
commite6eabeeeb25bbef82dd1fc85daf94b667a9d5d43
tree5f3a60e465d6f70844682a1975ab64f668d05a19
parent3228b19bdaa96a8263fd44224ac98f7b274e1b77
qa/tasks/ceph: create a log file before redirecting to it

as it is shell who interprets ">>" and redirect the stderr to given
file, but the shell process is launched by ubuntu:ububunt without using
sudo, so the command fails with "Permission denied" failure. to address
this issue, in this change, a file with proper priviledges is created
beforehand using `install`, so shell is able to write to it.

also, instead of creating this file in `maybe_redirect_stderr()`, it
returns the command to create the log file.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/ceph.py