From 7a6486bf4ddb2d789cc16047d8163baa8473e253 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Fri, 3 Sep 2021 14:24:48 -0400 Subject: [PATCH] ceph-volume: fix raw list with logical partition MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/ceph-volume/ceph_volume/devices/raw/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/devices/raw/list.py b/src/ceph-volume/ceph_volume/devices/raw/list.py index 054db345e8874..c86d4996f8d05 100644 --- a/src/ceph-volume/ceph_volume/devices/raw/list.py +++ b/src/ceph-volume/ceph_volume/devices/raw/list.py @@ -72,7 +72,7 @@ class List(object): # the parent disk has a bluestore header, but children may be the most appropriate # devices to return if the parent disk does not have a bluestore header. out, err, ret = process.call([ - 'lsblk', '--paths', '--output=NAME', '--noheadings', + 'lsblk', '--paths', '--output=NAME', '--noheadings', '--list' ]) assert not ret devs = out -- 2.39.5