]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: fix raw list with logical partition
authorDimitri Savineau <dsavinea@redhat.com>
Fri, 3 Sep 2021 18:24:48 +0000 (14:24 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 8 Sep 2021 11:16:10 +0000 (13:16 +0200)
commitba65838c34ae089b01c91216fc5919bd0ee2280b
treeead485071a8fe59cacba5be7f0adbe052ed868d8
parentde2ff3235604e552c891a35fe851afa9104bda08
ceph-volume: fix raw list with logical partition

This is a regression introduced by 9212420, when the host is using a
logical partition then lsblk reports that partition as a child from the
physical device.
That logical partition is prefixed by the `└─` character.

This leads the `raw list` subcommand to show the lsblk error on the stderr.

```
$ ceph-volume raw list
{}
 stderr: lsblk: `-/dev/sda1: not a block device
```

The lsblk command output looks like:

```
$ lsblk --paths --output=NAME --noheadings
/dev/sda
└─/dev/sda1
/dev/sdb
/dev/sdc
/dev/sdd
```

Using the `--list` option with lsblk solves the issue.

```
$ lsblk --list --paths --output=NAME --noheadings
/dev/sda
/dev/sda1
/dev/sdb
/dev/sdc
/dev/sdd
```

Fixes: https://tracker.ceph.com/issues/52504
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 7a6486bf4ddb2d789cc16047d8163baa8473e253)
src/ceph-volume/ceph_volume/devices/raw/list.py