mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
frr-reload: ignore-case in the es-id and es-sys-mac config comparisons
MAC address can be configured as lower/upper hex characters but is always rendered as lower case in "show run". Avoid incorrect "change detection" by ignoring case. Ticket: CM-32235 Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
This commit is contained in:
parent
ed37777f03
commit
8a63e80c6c
@ -221,6 +221,26 @@ ip forwarding
|
|||||||
for ligne in lines:
|
for ligne in lines:
|
||||||
self.dlines[ligne] = True
|
self.dlines[ligne] = True
|
||||||
|
|
||||||
|
def get_normalized_es_id(line):
|
||||||
|
"""
|
||||||
|
The es-id or es-sys-mac need to be converted to lower case
|
||||||
|
"""
|
||||||
|
sub_strs = ["evpn mh es-id", "evpn mh es-sys-mac"]
|
||||||
|
for sub_str in sub_strs:
|
||||||
|
obj = re.match(sub_str + " (?P<esi>\S*)", line)
|
||||||
|
if obj:
|
||||||
|
line = "%s %s" % (sub_str, obj.group("esi").lower())
|
||||||
|
break
|
||||||
|
return line
|
||||||
|
|
||||||
|
def get_normalized_mac_ip_line(line):
|
||||||
|
if line.startswith("evpn mh es"):
|
||||||
|
return get_normalized_es_id(line)
|
||||||
|
|
||||||
|
if not "ipv6 add" in line:
|
||||||
|
return get_normalized_ipv6_line(line)
|
||||||
|
|
||||||
|
return line
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
|
|
||||||
@ -251,11 +271,10 @@ class Config(object):
|
|||||||
# Compress duplicate whitespaces
|
# Compress duplicate whitespaces
|
||||||
line = " ".join(line.split())
|
line = " ".join(line.split())
|
||||||
|
|
||||||
if ":" in line and not "ipv6 add" in line:
|
if ":" in line:
|
||||||
qv6_line = get_normalized_ipv6_line(line)
|
line = get_normalized_mac_ip_line(line)
|
||||||
self.lines.append(qv6_line)
|
|
||||||
else:
|
self.lines.append(line)
|
||||||
self.lines.append(line)
|
|
||||||
|
|
||||||
self.load_contexts()
|
self.load_contexts()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user