Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSBlock cannot handle multi lines device item #3912

Open
JoySnow opened this issue Sep 8, 2023 · 0 comments
Open

LSBlock cannot handle multi lines device item #3912

JoySnow opened this issue Sep 8, 2023 · 0 comments

Comments

@JoySnow
Copy link
Collaborator

JoySnow commented Sep 8, 2023

Get this below special lsblk output case from a RHEL6 system.

The -luks-c666666c-e999-4666-8888-333333333333 (dm-0) device line was divided into two due to long device name.

LSBLK_DATA4 = """
NAME                           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                              8:0    0 136.7G  0 disk
|-sda1                           8:1    0   500M  0 part  /boot
`-sda2                           8:2    0 136.2G  0 part
  `-luks-c666666c-e999-4666-8888-333333333333 (dm-0)
                               253:0    0 136.2G  0 crypt
    |-vg0-lv_root (dm-1)       253:1    0    26G  0 lvm   /
    |-vg0-lv_swap (dm-2)       253:2    0    16G  0 lvm   [SWAP]
    |-vg0-lv_var (dm-5)        253:5    0    20G  0 lvm   /var
    |-vg0-lv_home (dm-6)       253:6    0    30G  0 lvm   /home
    |-vg0-lv_tmp (dm-7)        253:7    0    10G  0 lvm   /tmp
    `-vg0-lv_usr (dm-8)        253:8    0    20G  0 lvm   /usr
sdb                              8:16   0   1.7T  0 disk
`-promdatavg (dm-3)            253:3    0   1.7T  0 crypt
  `-promdatavg-promdata (dm-4) 253:4    0   1.7T  0 lvm   /promdata
sr0                             11:0    1  1024M  0 rom%
"""

Current Behavior:
The current LSBlock parser will skip this device in result.

print(results.rows[1])
print(results.rows[2])
print(results.rows[3])
print(results.rows[4])

Output:

part:sda1(/boot)
part:sda2
lvm:vg0-lv_root (dm-1)(/)
lvm:vg0-lv_swap (dm-2)([SWAP])

Expected Behavior:
LSBlock parser can parse it correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant