ceph-ansible/library
Guillaume Abrioux b46d2bf0a6 ceph_volume: fix bug in `is_lv()`
This function makes the `ceph_volume` module be not idempotent in
containerized context because it tries to run a container and bindmount
directories that no longer exist.

In that case, the `lvs` command being executed returns something
different than `0` so we can't call `json.loads(out)['report'][0]['lv']`
since it might throw an python error.

The idea is to return `True` only if `rc` is equal to `0` and
`len(result)` is greater than `0`, which means the command matched an
LV.

Fixes: #6284

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit ed79bc7a4e)
2021-03-25 14:11:11 +01:00
..
__init__.py tests for the ceph_volume module 2017-12-11 09:58:06 -06:00
ceph_add_users_buckets.py library: flake8 ceph-ansible modules 2020-10-06 08:56:45 +02:00
ceph_crush.py library: Fix new-style modules check mode 2020-12-01 09:53:26 -05:00
ceph_facts Discover rbd facts. 2018-11-20 15:06:01 +01:00
ceph_key.py mon: refact initial keyring generation 2020-12-01 09:53:26 -05:00
ceph_osd_flag.py library: add ceph_osd_flag module 2020-12-15 17:36:28 +01:00
ceph_volume.py ceph_volume: fix bug in `is_lv()` 2021-03-25 14:11:11 +01:00
config_template Using config_template 2015-12-16 17:19:50 +01:00
igw_client.py iscsi module linting 2018-10-30 14:41:36 +01:00
igw_gateway.py igw: Add check for mismatch ceph-iscsi and iscsigws.yml settings 2019-07-04 00:04:04 +00:00
igw_lun.py library: flake8 ceph-ansible modules 2020-10-06 08:56:45 +02:00
igw_purge.py library: flake8 ceph-ansible modules 2020-10-06 08:56:45 +02:00