Skip to content

shelf_id Bug #95

@jmwright

Description

@jmwright

The code here in device.py that gets the shelf_builder_id is supposed to just strip a trailing -6 or -st, but it seems to incorrectly force some shelf IDs to be generic.

The following JSON in devices.json leads to a generic shelf.

{"ID": "Western_Digital_Red_HDD","Type": "Storage","Hardware": "Western Digital Red HDD","Brand": "Western Digital", "Model": "WD20EFAX","Shelf": "HDD 3.5 Shelf","Rack": "6 in","ShelfId": "hdd35","HeightUnits": "2","LengthMm": "147.07 mm","Depth": "101.60 mm","Height": "26.16 mm","PoEIn": "","PoEOut": "","WattageMax": "","EstCostUsd": "$131.00","ProductWebsiteUsd": "","ProductWebsiteEur": "https://www.amazon.de/-/en/Western-Digital-Internal-Hard-Drive/dp/B083XVY99B/ref=sr_1_5","RAM": "","Field19": "","PoEInInputVoltage": "","Voltage": "","Amperage": "","WRTVersion": "","OpenWRTLink": "","Comments": "Part number is for the 2TB version"}

Whereas adding a -6 to the ShelfId fixes the issue.

{"ID": "Western_Digital_Red_HDD","Type": "Storage","Hardware": "Western Digital Red HDD","Brand": "Western Digital", "Model": "WD20EFAX","Shelf": "HDD 3.5 Shelf","Rack": "6 in","ShelfId": "hdd35-6","HeightUnits": "2","LengthMm": "147.07 mm","Depth": "101.60 mm","Height": "26.16 mm","PoEIn": "","PoEOut": "","WattageMax": "","EstCostUsd": "$131.00","ProductWebsiteUsd": "","ProductWebsiteEur": "https://www.amazon.de/-/en/Western-Digital-Internal-Hard-Drive/dp/B083XVY99B/ref=sr_1_5","RAM": "","Field19": "","PoEInInputVoltage": "","Voltage": "","Amperage": "","WRTVersion": "","OpenWRTLink": "","Comments": "Part number is for the 2TB version"}

@julianstirling

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions