From: Dimitri Savineau Date: Fri, 3 Sep 2021 18:24:48 +0000 (-0400) Subject: ceph-volume: fix raw list with logical partition X-Git-Tag: v16.2.6~14^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ba65838c34ae089b01c91216fc5919bd0ee2280b;p=ceph.git 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 (cherry picked from commit 7a6486bf4ddb2d789cc16047d8163baa8473e253) --- 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