Skip to content

[carbon] Devices: fix import errors

Matt requested to merge dev/ecodiag_fix into main

The code that built the ComputerDevice from the database used Device.fromRegex which is wrong. Indeed we store the key (e.g type=harddrive, model=default) which doesn't match the type/model regexp of ecodiag devices and throw an exception when inserting in the store. One should use Device.fromType instead (as we can assume that the type/model is correct -- see below)

The patch also simplifies our ecodiag use. A ComputerDevice wraps an Ecodiag Device Object so ComputerDevice are highly coupled to Ecodiag Device. In particular we must ensure in the future that Ecodiag Device are valid to manipulate ComputerDevice on our side.

Merge request reports

Loading