Skip to content

Commit

Permalink
Confirmation check for mgmtvrf should only be for mgmt IP and not che…
Browse files Browse the repository at this point in the history
…ck for loopback

Signed-off-by: irene_pan [email protected]
  • Loading branch information
irene-pan1202 committed Aug 21, 2024
1 parent 791373e commit 9226464
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 9226464

Please sign in to comment.