Skip to content

Commit 9226464

Browse files
committed
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
1 parent 791373e commit 9226464

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

config/main.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -3182,8 +3182,10 @@ def add_snmp_agent_address(ctx, agentip, port, vrf):
31823182
if not vrf:
31833183
entry = config_db.get_entry('MGMT_VRF_CONFIG', "vrf_global")
31843184
if entry and entry['mgmtVrfEnabled'] == 'true' :
3185-
click.echo("ManagementVRF is Enabled. Provide vrf.")
3186-
return False
3185+
mgmtintf_key_list = _get_all_mgmtinterface_keys()
3186+
if any(ip.split('/')[0].lower() == agentip.lower() for _, ip in mgmtintf_key_list):
3187+
click.echo("ManagementVRF is Enabled. Provide vrf.")
3188+
return False
31873189
found = 0
31883190
ip = ipaddress.ip_address(agentip)
31893191
for intf in netifaces.interfaces():

0 commit comments

Comments
 (0)