Kathara
Kathara copied to clipboard
Add custom exceptions
We need to add custom exceptions to improve error handling and troubleshooting.
We need to change all these basic exceptions:
-
src/Kathara/utils.py
- [x] raise Exception("Not implemented for %s." % architecture)
-
src/Kathara/auth/PrivilegeHandler.py
- [x] raise Exception("This class is a singleton!")
-
src/Kathara/cli/command/ListCommand.py
- [x] raise Exception("You must be root in order to show all Kathara devices of all users.")
-
src/Kathara/cli/command/LstartCommand.py
- [x] raise Exception("You must be root in order to start Kathara devices in privileged mode.")
- [x] raise Exception("No devices in the current network scenario. Exiting...")
-
src/Kathara/cli/command/VstartCommand.py
- [x] raise Exception("You must be root in order to start this Kathara device in privileged mode.")
- [x] raise Exception("Interface number in
--eth %s:%sis not a number." % (iface_number, cd))
-
src/Kathara/cli/command/WipeCommand.py
- [x] raise Exception("You must be root in order to wipe all Kathara devices of all users.")
-
src/Kathara/cli/ui/utils.py
- [x] raise Exception("Unable to find Kathara.")
-
src/Kathara/event/EventDispatcher.py
- [x] raise Exception("This class is a singleton!")
-
src/Kathara/foundation/cli/CliArgs.py
- [x] raise Exception("This class is a singleton!")
-
src/Kathara/foundation/cli/ui/setting/OptionsHandler.py
- [x] raise Exception("
addcalled without a MenuFactory set.")
- [x] raise Exception("
-
src/Kathara/manager/Kathara.py
- [x] raise Exception("This class is a singleton!")
-
src/Kathara/manager/docker/DockerImage.py
- [x] raise Exception("Docker Image
%sis not compatible with your host architecture: %s." % (image_name, e.arch)) - [x] raise Exception("Docker Image
%sis not available neither on Docker Hub nor in local repository!" % image_name) - [x] raise Exception("Docker Image
%sis not compatible with your host architecture%s." % (image_name, e.arch))
- [x] raise Exception("Docker Image
-
src/Kathara/manager/docker/DockerLink.py
- [x] raise Exception("No collision domains found.")
- [x] raise Exception(f"Collision domains with name {link_name} not found.")
-
src/Kathara/manager/docker/DockerMachine.py
- [x] raise Exception("The specified device
%sis not running." % machine_name) - [x] raise Exception("The specified device
%sis not running." % machine_name) - [x] raise Exception("No devices found.")
- [x] raise Exception(f"Devices with name {machine_name} not found.")
- [x] raise Exception("The specified device
-
src/Kathara/manager/docker/DockerManager.py
- [x] raise Exception("Machine
%sis not associated to a network scenario." % machine.name) - [x] raise Exception("Collision domain
%sis not associated to a network scenario." % link.name) - [x] raise Exception(f"The following devices are not in the network scenario: {machines_not_in_lab}.")
- [x] raise Exception("Machine
%sis not associated to a network scenario." % machine.name) - [x] raise Exception("Machine
%sis already connected to collision domain%s." % (machine.name, link.name)) - [x] raise Exception("Machine
%sis not associated to a network scenario." % machine.name) - [x] raise Exception("Machine
%sis not connected to collision domain%s." % (machine.name, link.name)) - [x] raise Exception("Machine
%sis not associated to a network scenario." % machine.name) - [x] raise Exception("Collision domain
%sis not associated to a network scenario." % link.name) - [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception(f"Device
{machine_name}not found.") - [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception(f"Collision Domain
{link_name}not found.") - [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("Machine
-
src/Kathara/manager/docker/DockerPlugin.py
- [x] raise Exception("Kathara Network Plugin not found on remote Docker connection.")
- [x] raise Exception("Kathara Network Plugin not enabled on remote Docker connection.")
-
src/Kathara/manager/kubernetes/KubernetesConfigMap.py
- [x] raise Exception(
-
src/Kathara/manager/kubernetes/KubernetesLink.py
- [x] raise Exception("No collision domains found.")
- [x] raise Exception(f"Collision domains with name {link_name} not found.")
-
src/Kathara/manager/kubernetes/KubernetesMachine.py
- [x] raise Exception("The specified device
%sis not running." % machine_name) - [x] raise Exception('Device
%sis not ready.' % machine_name) - [x] raise Exception("The specified device
%sis not running." % machine_name) - [x] raise Exception("No devices found.")
- [x] raise Exception(f"Devices with name {machine_name} not found.")
- [x] raise Exception("The specified device
-
src/Kathara/manager/kubernetes/KubernetesManager.py
- [x] raise Exception("Machine
%sis not associated to a network scenario." % machine.name) - [x] raise Exception("Collision domain
%sis not associated to a network scenario." % link.name) - [x] raise Exception(f"The following devices are not in the network scenario: {machines_not_in_lab}.")
- [x] raise Exception("Previous lab execution is still terminating. Please wait.")
- [x] raise Exception("Machine
%sis not associated to a network scenario." % machine.name) - [x] raise Exception("Collision domain
%sis not associated to a network scenario." % link.name) - [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception(f"Device {machine_name} not found.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception(f"Collision Domain {link_name} not found.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("You must specify a running network scenario hash or name.")
- [x] raise Exception("Machine
-
src/Kathara/model/Lab.py
- [x] raise Exception("Collision domain
%s(declared in lab.ext) not found in lab " - [x] raise Exception("
sharedfolder is a symlink, delete it.")
- [x] raise Exception("Collision domain
-
src/Kathara/model/Machine.py
- [x] raise Exception("Invalid device name
%s." % name) - [x] raise Exception("Interface %d already set on device
%s." % (number, self.name)) - [x] raise Exception("Device
%sis not connected to collision domain%s." % (self.name, link.name))
- [x] raise Exception("Invalid device name
-
src/Kathara/os/Networking.py
- [x] raise Exception("Interface
%snot found." % full_interface_name) - [x] raise Exception("Cannot find
iptablesin the host.")
- [x] raise Exception("Interface
-
src/Kathara/parser/netkit/DepParser.py
- [x] raise Exception("[ERROR] In lab.dep - line %d: Syntax error." % line_number)
- [x] raise Exception("ERROR: Loop in lab.dep.\n")
-
src/Kathara/parser/netkit/ExtParser.py
- [x] raise Exception("[ERROR] In file lab.ext, line %d: "
- [x] raise Exception("[ERROR] In file lab.ext, line %d malformed." % line_number)
-
src/Kathara/parser/netkit/LabParser.py
- [x] raise Exception("[ERROR] In line %d: "
- [x] raise Exception("[ERROR] In line %d: "
- [x] raise Exception("[ERROR] In line %d: Invalid characters
%s." % (line_number, line))
-
src/Kathara/setting/Setting.py
- [x] raise Exception("This class is a singleton!")