Skip to content

Commit

Permalink
Devices/Device.py: Fix for broken cleanup() with missing tc tool
Browse files Browse the repository at this point in the history
If no tc utility is present on the agent system, exec_cmd() raises an
exception. If uncaught, the previous address flush request will also not
complete. The address remaining in place will cause an EEXIST error upon
next test run, requiring manual intervention to resolve the situation.

Fixes: 49e523d ("Slave: Add basic support for tc.")
Signed-off-by: Phil Sutter <[email protected]>
  • Loading branch information
SirPhuttel authored and olichtne committed Feb 21, 2024
1 parent bd86ed0 commit 28d0e16
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lnst/Devices/Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,11 @@ def cleanup(self):

self.down()
self.ip_flush()
self._clear_tc_qdisc()
self._clear_tc_filters()
try:
self._clear_tc_qdisc()
self._clear_tc_filters()
except ExecCmdFail:
pass

self.restore_original_data()

Expand Down

0 comments on commit 28d0e16

Please sign in to comment.