Kathara icon indicating copy to clipboard operation
Kathara copied to clipboard

Better error handling for `network/endpoint does not exist` exception throwed by Kathara NP

Open tcaiazzi opened this issue 2 years ago • 0 comments

Describe the bug If you reboot the host system while a network scenario is running, after the reboot you get an error from the network plugin when you try to run a device attached to a collision domain that has the same name of ones used in the network scenario deployed before the reboot.

To Reproduce Steps to reproduce the behavior:

  1. Run a network scenario
  2. Reboot the host system
  3. After the reboot, run a device attached to a collision domain with the same name of ones in the network scenario run before.
  4. Get the network does not exist exception from the network plugin.

Expected behavior We need to improve the error handling adding a custom exception that clearly explains the error, which can be solved using the wipe command.

To Do We need to improve error handling in the DockerMachine class in the following methods:

  • [x] connect_to_link(machine: Machine, link: Link) -> None
  • [x] start(machine: Machine) -> None
  • [x] Add relative unit tests

We will throw the DockerPluginError("Kathara has been left in an inconsistent state! Please run 'kathara wipe'.") instead of the APIError exception.

tcaiazzi avatar Sep 09 '22 11:09 tcaiazzi