]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: drop unnecessary call to `get_single_lv()` 60055/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Mon, 30 Sep 2024 09:17:11 +0000 (09:17 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Mon, 30 Sep 2024 11:10:42 +0000 (13:10 +0200)
commitc0e05bf36067294420631f33c5e43c32077eeb82
tree6b5775a768f343028b4caa1d9e480af2c18e13a8
parent41f803acb4b691219755903bca90d15b79bc6955
ceph-volume: drop unnecessary call to `get_single_lv()`

`Zap.zap_lv()` currently makes a call to `get_single_lv()`:

```
        lv = api.get_single_lv(filters={'lv_name': device.lv_name,
                                        'vg_name': device.vg_name})
```

this isn't needed and redundant as zap_lv() takes an instance of `Device()`
as argument which has already a `lv_api` attribute:

class Device in device.py:

```
            else:
                vgname, lvname = self.path.split('/')
                filters = {'lv_name': lvname, 'vg_name': vgname}
            lv = lvm.get_single_lv(filters=filters)         # <---- same call

        if lv:
            self.lv_api = lv
```

This implies a duplicate call to `subprocess.Popen()` unnecessarily.

Fixes: https://tracker.ceph.com/issues/68312
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/ceph-volume/ceph_volume/devices/lvm/zap.py