]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: drop unnecessary call to `get_single_lv()` 60353/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Mon, 30 Sep 2024 09:17:11 +0000 (09:17 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Wed, 16 Oct 2024 09:45:31 +0000 (09:45 +0000)
commite75d2942c9ba54d62218d1fe328b1681b6cdcb02
treeae240be35a340a46984f2b97550f28a7158dd37f
parent649e72305bd164928bf08bca9fc1bbb45328d936
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>
(cherry picked from commit c0e05bf36067294420631f33c5e43c32077eeb82)
src/ceph-volume/ceph_volume/devices/lvm/zap.py