]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephadm: fix error handling in `command_check_host()` 33048/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 3 Feb 2020 17:34:11 +0000 (18:34 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 3 Feb 2020 17:43:39 +0000 (18:43 +0100)
commitf67610c73cd8ef60e223e64de2fa4edaba9a79aa
tree1ff78477475577c350abc873bbfaba2324880141
parentfed96416dcb691ab0df23ccdf23ddd6fc72f6158
cephadm: fix error handling in `command_check_host()`

`find_program()` raises `ValueError` when the executable hasn't been
found. It means we need to catch `ValueError` exception in
`command_check_host()` and raise `Error` instead of `RuntimeError` since
only `Error` is caught at the end.

Typical failure:

```
INFO:cephadm:/usr/bin/ceph:stderr Error ENOENT: New host mon1 failed check: ['INFO:cephadm:podman|docker (/bin/podman) is present', 'INFO:cephadm:systemctl is present', 'Traceback (most recent call last):', '  File "<stdin>", line 2820, in <module>', '  File "<stdin>", line 2434, in command_check_host', '  File "<stdin>", line 796, in find_program', 'ValueError: lvcreate not found']
```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
src/cephadm/cephadm