Skip to content

Commit

Permalink
Simplify exception in Managers (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skazza94 committed May 16, 2024
1 parent 732e042 commit 23a94d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Kathara/manager/docker/DockerManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def deploy_lab(self, lab: Lab, selected_machines: Optional[Set[str]] = None,
lab.check_integrity()

if selected_machines and excluded_machines:
raise InvocationError(f"You can either specify `selected_machines` or `excluded_machines`.")
raise InvocationError(f"You can either select or exclude devices.")

if selected_machines and not lab.has_machines(selected_machines):
machines_not_in_lab = selected_machines - set(lab.machines.keys())
Expand Down Expand Up @@ -321,7 +321,7 @@ def undeploy_lab(self, lab_hash: Optional[str] = None, lab_name: Optional[str] =
lab_hash = utils.generate_urlsafe_hash(lab_name)

if selected_machines and excluded_machines:
raise InvocationError(f"You can either specify `selected_machines` or `excluded_machines`.")
raise InvocationError(f"You can either select or exclude devices.")

self.docker_machine.undeploy(lab_hash, selected_machines=selected_machines, excluded_machines=excluded_machines)

Expand Down
4 changes: 2 additions & 2 deletions src/Kathara/manager/kubernetes/KubernetesManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def deploy_lab(self, lab: Lab, selected_machines: Optional[Set[str]] = None,
lab.check_integrity()

if selected_machines and excluded_machines:
raise InvocationError(f"You can either specify `selected_machines` or `excluded_machines`.")
raise InvocationError(f"You can either select or exclude devices.")

if selected_machines and not lab.has_machines(selected_machines):
machines_not_in_lab = selected_machines - set(lab.machines.keys())
Expand Down Expand Up @@ -273,7 +273,7 @@ def undeploy_lab(self, lab_hash: Optional[str] = None, lab_name: Optional[str] =
lab_hash = utils.generate_urlsafe_hash(lab_name)

if selected_machines and excluded_machines:
raise InvocationError(f"You can either specify `selected_machines` or `excluded_machines`.")
raise InvocationError(f"You can either select or exclude devices.")

lab_hash = lab_hash.lower()

Expand Down

0 comments on commit 23a94d5

Please sign in to comment.