Skip to content

Commit 9daa36b

Browse files
authored
Version 0.1.13
2 parents a03014e + 8885bb7 commit 9daa36b

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "kathara_lab_checker"
3-
version = "0.1.12"
3+
version = "0.1.13"
44
description = "Tool to automatically check Kathará network scenarios based on a configuration file."
55
readme = "README.md"
66
requires-python = ">=3.11"

src/kathara_lab_checker/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from .foundation.checks.CheckFactory import CheckFactory
2424
from .foundation.model.CheckResult import CheckResult
2525

26-
VERSION = "0.1.12"
26+
VERSION = "0.1.13"
2727
CURRENT_LAB: Optional[Lab] = None
2828

2929

src/kathara_lab_checker/checks/BridgeCheck.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,9 @@ def check_vlan_pvid(self, device_name: str, interface_name: str, interface_pvid:
161161
reason = f"No pvid configured on `{interface_name}` of `{device_name}`"
162162
return FailedCheck(self.description, reason)
163163

164-
def run(self, configuration: dict[str, Any]) -> list[CheckResult]:
164+
def run(self, devices_to_bridge_configuration: dict[str, Any]) -> list[CheckResult]:
165165
results = []
166166

167-
if 'bridges' not in configuration:
168-
return results
169-
170-
devices_to_bridge_configuration = configuration["bridges"]
171167
for device_name, bridges_configuration in devices_to_bridge_configuration.items():
172168
self.logger.info(f"Checking bridges configuration on `{device_name}`...")
173169
try:
@@ -256,8 +252,8 @@ def run(self, configuration: dict[str, Any]) -> list[CheckResult]:
256252
return results
257253

258254
def run_from_configuration(self, configuration: dict) -> list[CheckResult]:
259-
self.logger.info("Verifying bridges configuration inside devices...")
260255
if key_exists(["test", "bridges"], configuration):
256+
self.logger.info("Verifying bridges configuration inside devices...")
261257
return self.run(configuration["test"]["bridges"])
262258
else:
263259
return []

src/kathara_lab_checker/checks/protocols/bgp/BGPNeighborCheck.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
22

3-
from Kathara.exceptions import MachineNotRunningError
3+
from Kathara.exceptions import MachineNotRunningError, MachineBinaryError
44
from Kathara.model.Lab import Lab
55

66
from ....foundation.checks.AbstractCheck import AbstractCheck
@@ -28,6 +28,12 @@ def check(self, device_name: str, neighbors: list) -> list[CheckResult]:
2828
except MachineNotRunningError as e:
2929
results.append(FailedCheck(f"Checking {device_name} BGP neighbors", str(e)))
3030
return results
31+
except MachineBinaryError as e:
32+
results.append(FailedCheck(f"Checking {device_name} BGP neighbors", str(e)))
33+
return results
34+
except Exception as e:
35+
results.append(FailedCheck(f"Checking {device_name} BGP neighbors", str(e)))
36+
return results
3137

3238
output = stdout.decode("utf-8") if stdout else None
3339

0 commit comments

Comments
 (0)