diff --git a/anta/tests/aaa.py b/anta/tests/aaa.py index afedf1e64..250cc3f4e 100644 --- a/anta/tests/aaa.py +++ b/anta/tests/aaa.py @@ -6,7 +6,7 @@ import logging from typing import Any, Dict, List, Optional, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/configuration.py b/anta/tests/configuration.py index 848cad77e..65e90f8e3 100644 --- a/anta/tests/configuration.py +++ b/anta/tests/configuration.py @@ -8,7 +8,7 @@ import logging -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/connectivity.py b/anta/tests/connectivity.py index aa5d4e052..d6daf2b21 100644 --- a/anta/tests/connectivity.py +++ b/anta/tests/connectivity.py @@ -5,7 +5,7 @@ import logging -from anta.models import AntaTest, AntaTemplate +from anta.models import AntaTemplate, AntaTest logger = logging.getLogger(__name__) @@ -34,11 +34,10 @@ def test(self) -> None: failures = [] for command in self.instance_commands: - if command.template and command.template.vars and \ - ('src' and 'dst') in command.template.vars: + if command.template and command.template.vars and ("src" and "dst") in command.template.vars: src, dst = command.template.vars["src"], command.template.vars["dst"] else: - self.result.is_error('The destination IP(s) or the source interface/IP(s) are not provided as template_params') + self.result.is_error("The destination IP(s) or the source interface/IP(s) are not provided as template_params") return if "2 received" not in command.json_output["messages"][0]: diff --git a/anta/tests/field_notices.py b/anta/tests/field_notices.py index 0fbb2a7df..b4a2da732 100644 --- a/anta/tests/field_notices.py +++ b/anta/tests/field_notices.py @@ -5,7 +5,7 @@ from typing import Any, Dict, cast from anta.decorators import skip_on_platforms -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/hardware.py b/anta/tests/hardware.py index e6f88f876..a4f5b6088 100644 --- a/anta/tests/hardware.py +++ b/anta/tests/hardware.py @@ -7,7 +7,7 @@ from typing import Any, Dict, List, Optional, cast from anta.decorators import skip_on_platforms -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/interfaces.py b/anta/tests/interfaces.py index f67ae1ed4..6d4ca15b5 100644 --- a/anta/tests/interfaces.py +++ b/anta/tests/interfaces.py @@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, cast from anta.decorators import skip_on_platforms -from anta.models import AntaTest, AntaCommand, AntaTemplate +from anta.models import AntaCommand, AntaTemplate, AntaTest logger = logging.getLogger(__name__) @@ -401,11 +401,10 @@ def test(self) -> None: disabled_intf = [] for command in self.instance_commands: - if command.template and command.template.vars and \ - 'intf' in command.template.vars: - intf = command.template.vars['intf'] + if command.template and command.template.vars and "intf" in command.template.vars: + intf = command.template.vars["intf"] else: - self.result.is_error('A list of interface(s) is not provided as template_params') + self.result.is_error("A list of interface(s) is not provided as template_params") return logger.debug(command) if not command.json_output["interfaces"][intf]["proxyArp"]: diff --git a/anta/tests/logging.py b/anta/tests/logging.py index 37b6d67f8..0e4d30333 100644 --- a/anta/tests/logging.py +++ b/anta/tests/logging.py @@ -9,7 +9,7 @@ import re from typing import Any, Dict, List, Optional, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/mlag.py b/anta/tests/mlag.py index 2936e08c8..60e02a595 100644 --- a/anta/tests/mlag.py +++ b/anta/tests/mlag.py @@ -4,7 +4,7 @@ import logging from typing import Any, Dict, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/multicast.py b/anta/tests/multicast.py index ed5a1e6fc..94111fb88 100644 --- a/anta/tests/multicast.py +++ b/anta/tests/multicast.py @@ -4,7 +4,7 @@ import logging from typing import Any, Dict, List, Optional, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/profiles.py b/anta/tests/profiles.py index 77b684088..f984460cb 100644 --- a/anta/tests/profiles.py +++ b/anta/tests/profiles.py @@ -5,7 +5,7 @@ from typing import Any, Dict, Optional, cast from anta.decorators import skip_on_platforms -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/routing/bgp.py b/anta/tests/routing/bgp.py index c9f1715b6..f9ec70ff7 100644 --- a/anta/tests/routing/bgp.py +++ b/anta/tests/routing/bgp.py @@ -5,7 +5,7 @@ from typing import Any, Dict, Optional, cast from anta.decorators import check_bgp_family_enable -from anta.models import AntaTest, AntaCommand, AntaTemplate +from anta.models import AntaCommand, AntaTemplate, AntaTest logger = logging.getLogger(__name__) @@ -105,11 +105,10 @@ def test(self, number: Optional[int] = None) -> None: self.result.is_success() for command in self.instance_commands: - if command.template and command.template.vars and \ - "vrf" in command.template.vars: - vrf = command.template.vars['vrf'] + if command.template and command.template.vars and "vrf" in command.template.vars: + vrf = command.template.vars["vrf"] else: - self.result.is_error('A list of VRF(s) is not provided as template_params') + self.result.is_error("A list of VRF(s) is not provided as template_params") return peers = command.json_output["vrfs"][vrf]["peers"] diff --git a/anta/tests/routing/generic.py b/anta/tests/routing/generic.py index 0b321178f..4e7534886 100644 --- a/anta/tests/routing/generic.py +++ b/anta/tests/routing/generic.py @@ -4,7 +4,7 @@ import logging from typing import Any, Dict, Optional, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/routing/ospf.py b/anta/tests/routing/ospf.py index 13db81feb..b64780ddf 100644 --- a/anta/tests/routing/ospf.py +++ b/anta/tests/routing/ospf.py @@ -6,7 +6,7 @@ import logging from typing import Any, Dict, List, Optional, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/security.py b/anta/tests/security.py index 6f9061bcd..70e7e081e 100644 --- a/anta/tests/security.py +++ b/anta/tests/security.py @@ -6,7 +6,7 @@ import logging from typing import Any, Dict, Optional, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/snmp.py b/anta/tests/snmp.py index e0b93a976..dd95fd4ba 100644 --- a/anta/tests/snmp.py +++ b/anta/tests/snmp.py @@ -6,7 +6,7 @@ import logging from typing import Any, Dict, Optional, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/software.py b/anta/tests/software.py index 34853355f..cab37521e 100644 --- a/anta/tests/software.py +++ b/anta/tests/software.py @@ -4,7 +4,7 @@ import logging from typing import Any, Dict, List, Optional, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/stp.py b/anta/tests/stp.py index 5fad49fbb..66ca02c96 100644 --- a/anta/tests/stp.py +++ b/anta/tests/stp.py @@ -6,7 +6,7 @@ import logging from typing import Any, Dict, List, Optional, cast -from anta.models import AntaTest, AntaCommand, AntaTemplate +from anta.models import AntaCommand, AntaTemplate, AntaTest from anta.tools.get_value import get_value logger = logging.getLogger(__name__) @@ -58,11 +58,10 @@ def test(self, mode: str = "mstp") -> None: self.result.is_success() for command in self.instance_commands: - if command.template and command.template.vars and \ - "vlan" in command.template.vars: - vlan_id = command.template.vars['vlan'] + if command.template and command.template.vars and "vlan" in command.template.vars: + vlan_id = command.template.vars["vlan"] else: - self.result.is_error('A list of VLAN(s) is not provided as template_params') + self.result.is_error("A list of VLAN(s) is not provided as template_params") return if not (stp_mode := get_value(command.json_output, f"spanningTreeVlanInstances.{vlan_id}.spanningTreeVlanInstance.protocol")): self.result.is_failure(f"STP mode '{mode}' not configured for VLAN {vlan_id}") @@ -157,11 +156,10 @@ def test(self) -> None: self.result.is_success() for command in self.instance_commands: - if command.template and command.template.vars and \ - "vlan" in command.template.vars: - vlan_id = command.template.vars['vlan'] + if command.template and command.template.vars and "vlan" in command.template.vars: + vlan_id = command.template.vars["vlan"] else: - self.result.is_error('A list of VLAN(s) is not provided as template_params') + self.result.is_error("A list of VLAN(s) is not provided as template_params") return if not (topologies := get_value(command.json_output, "topologies")): diff --git a/anta/tests/system.py b/anta/tests/system.py index faf54ee6d..b04b44a07 100644 --- a/anta/tests/system.py +++ b/anta/tests/system.py @@ -6,7 +6,7 @@ import logging from typing import Any, Dict, List, Optional, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__) diff --git a/anta/tests/vxlan.py b/anta/tests/vxlan.py index 406cc9957..069002b06 100644 --- a/anta/tests/vxlan.py +++ b/anta/tests/vxlan.py @@ -4,7 +4,7 @@ import logging from typing import Any, Dict, cast -from anta.models import AntaTest, AntaCommand +from anta.models import AntaCommand, AntaTest logger = logging.getLogger(__name__)