]> git.apps.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>
Tue, 7 Sep 2021 13:37:09 +0000 (15:37 +0200)
commit7a6486bf4ddb2d789cc16047d8163baa8473e253
tree5da29286d709ff748e55e6e8ec93dfa15c7ce4f6
parentff3cda4a9d84ad5dc0dfff56db090f8a632d9d76
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>
src/ceph-volume/ceph_volume/devices/raw/list.py