From 2c64aa9e1094031012ab1d767114311027cd3664 Mon Sep 17 00:00:00 2001 From: Laxmikant Chintakindi Date: Thu, 10 Oct 2024 11:11:40 +0530 Subject: [PATCH] Fix code. --- .../connected_endpoints/monitor_sessions.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/monitor_sessions.py b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/monitor_sessions.py index 1f62e8cf404..7f1ee8185c5 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/monitor_sessions.py +++ b/python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/monitor_sessions.py @@ -48,9 +48,10 @@ def monitor_sessions(self: AvdStructuredConfigConnectedEndpoints) -> list | None "direction": get(session, "source_settings.direction"), } - if get(merged_settings, "session_settings.access_group") is not None: - if get(session, "source_settings.access_group") is not None: - msg = f"For {self.shared_utils.hostname}, an ACL is set on {session["interface"]} even though ACL is set for session {session_name}." + if get(merged_settings, "session_settings.access_group") is not None and get(session, "source_settings.access_group") is not None: + msg = ( + f"For {self.shared_utils.hostname}, an ACL is set on {session["interface"]} even though ACL is set for monitor session {session_name}." + ) raise AristaAvdError(msg) elif (access_group := get(session, "source_settings.access_group")) is not None: