Skip to content

Commit

Permalink
Devices/Device.py: report unsupported feature for switchdev corner case
Browse files Browse the repository at this point in the history
In some cases a query of switchdev info on a device could return an empty
string. When this happens the code expects either legacy or switchdev
mode in the output, otherwise a DeviceError is raised.

The DeviceError causes termination of the machine's device cleanup
process and some devices may be left without deconfiguration.

Since this case should not be considered as a critical issue a
DeviceFeatureNotSupported is raised instead that is accepted during the
deconfiguration.

Signed-off-by: Jan Tluka <[email protected]>
  • Loading branch information
jtluka committed Dec 8, 2023
1 parent 306e21d commit d4834ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lnst/Devices/Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ def eswitch_mode(self):
try:
return m.group(1)
except AttributeError:
raise DeviceError(f"Could not parse device {self.name} eswitch mode")
raise DeviceFeatureNotSupported(f"Could not parse device {self.name} eswitch mode")

@eswitch_mode.setter
def eswitch_mode(self, mode):
Expand Down

0 comments on commit d4834ce

Please sign in to comment.