summaryrefslogtreecommitdiffstats
path: root/anta/tests/routing/bgp.py
diff options
context:
space:
mode:
Diffstat (limited to 'anta/tests/routing/bgp.py')
-rw-r--r--anta/tests/routing/bgp.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/anta/tests/routing/bgp.py b/anta/tests/routing/bgp.py
index 3b99a02..41c2495 100644
--- a/anta/tests/routing/bgp.py
+++ b/anta/tests/routing/bgp.py
@@ -262,8 +262,8 @@ class VerifyBGPPeerCount(AntaTest):
command_output = command.json_output
afi = command.params.afi
- safi = command.params.safi
- afi_vrf = command.params.vrf or "default"
+ safi = command.params.safi if hasattr(command.params, "safi") else None
+ afi_vrf = command.params.vrf if hasattr(command.params, "vrf") else "default"
# Swapping AFI and SAFI in case of SR-TE
if afi == "sr-te":
@@ -400,12 +400,12 @@ class VerifyBGPPeersHealth(AntaTest):
command_output = command.json_output
afi = command.params.afi
- safi = command.params.safi
+ safi = command.params.safi if hasattr(command.params, "safi") else None
+ afi_vrf = command.params.vrf if hasattr(command.params, "vrf") else "default"
# Swapping AFI and SAFI in case of SR-TE
if afi == "sr-te":
afi, safi = safi, afi
- afi_vrf = command.params.vrf or "default"
if not (vrfs := command_output.get("vrfs")):
_add_bgp_failures(failures=failures, afi=afi, safi=safi, vrf=afi_vrf, issue="Not Configured")
@@ -551,8 +551,8 @@ class VerifyBGPSpecificPeers(AntaTest):
command_output = command.json_output
afi = command.params.afi
- safi = command.params.safi
- afi_vrf = command.params.vrf or "default"
+ safi = command.params.safi if hasattr(command.params, "safi") else None
+ afi_vrf = command.params.vrf if hasattr(command.params, "vrf") else "default"
# Swapping AFI and SAFI in case of SR-TE
if afi == "sr-te":