This is not perfect, but we have seen cases where the CLI returns 0 even
on failure.
For instance:
```sh
[root@rook-ceph-crashcollector-compute-1-
66bdfbd886-d2zcd /]# ceph -n client.crash crash post -i /var/lib/ceph/crash/2021-06-28T07\:47\:37.859766Z_6ffb119c-930e-4047-9cfa-
a92af783cdd0/meta
malformed crash metadata: time data '2021-06-28T07:47:37.859766' does not match format '%Y-%m-%d %H:%M:%S.%f'
[root@rook-ceph-crashcollector-compute-1-
66bdfbd886-d2zcd /]# echo $?
0
```
So until we find the root cause, let's mitigate and perhaps accomodate
for futur similar issues.
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit
a77b47eeeb5770eeefcf4619ab2105ee7a6a003e)
stderr = pr.communicate(input=f.read())
rc = pr.wait()
f.close()
- if rc != 0:
+ if rc != 0 or stderr != "":
log.warning('post %s as %s failed: %s' % (path, n, stderr))
if rc == 0:
break