Skip to content

5.0.9 to 5.0.14 Disk Scanning fails for leading space in lsblk values #2907

@Hooverdan96

Description

@Hooverdan96

Thanks to user cellisten on the community forum, there seems to be an issue when the model name contains a space within. Usual nomenclature found on model names usually does not contain any spaces.

https://forum.rockstor.com/t/scanning-disks-not-working/9781

There seems to already be a hint on how to address it, but that needs confirmation that it won't have an impact on other scenarios. From the message thread:

I did some refactoring of the generation of the blk_dev_properties to separate the line in a manner where spaces don’t really matter and the strip is done differently:

line = [ item.strip() for item in re.split(r'["=]', line) ]
line = [ item for i, item in enumerate(line,-1) if i %3 != 0 ]
# Device information built from each lsblk line in turn.
blk_dev_properties: dict = {
key.lower() if key != "TRAN" else "transport":
value if value != "" else None for key, value in zip(line[::2], line[1::2])
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions