From 922646462e8a54452d6699666e8f5165dc96d62d Mon Sep 17 00:00:00 2001 From: irene_pan Date: Wed, 21 Aug 2024 01:34:59 +0000 Subject: [PATCH] Confirmation check for mgmtvrf should only be for mgmt IP and not check for loopback Signed-off-by: irene_pan irene_pan@edge-core.com --- config/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/main.py b/config/main.py index 0077b360..02a15a82 100644 --- a/config/main.py +++ b/config/main.py @@ -3182,8 +3182,10 @@ def add_snmp_agent_address(ctx, agentip, port, vrf): if not vrf: entry = config_db.get_entry('MGMT_VRF_CONFIG', "vrf_global") if entry and entry['mgmtVrfEnabled'] == 'true' : - click.echo("ManagementVRF is Enabled. Provide vrf.") - return False + mgmtintf_key_list = _get_all_mgmtinterface_keys() + if any(ip.split('/')[0].lower() == agentip.lower() for _, ip in mgmtintf_key_list): + click.echo("ManagementVRF is Enabled. Provide vrf.") + return False found = 0 ip = ipaddress.ip_address(agentip) for intf in netifaces.interfaces():