Inconsistent VRF vpn_id generation
Steps to reproduce
In the interface igetmplsvpn the StringParameter for the "type" parameter defines the choices to be lower case. The interface also generates the vpn_id in the "clean_result" and "script_clean_result" methods and in this case the lower case vpn type will be passed to the "get_vpn_id" method of core/vpn.py. Other parts of the system, especially ip/models/vrf.py, convert the vpn type to upper case before passing it over to "get_vpn_id".
What is the current bug behavior?
Manually created or imported VRFs will generate another vpn_id than the box discovery.
Possible fixes
Ensure the uppercase vpn type for "vrf" and "vpls" inside of get_vpn_id
diff --git a/core/vpn.py b/core/vpn.py
@@ -44,6 +45,7 @@ def get_vpn_id(vpn):
identity = vpn["name"]
else:
raise ValueError("Cannot calculate VPN id")
+ vpn["type"] = vpn["type"].upper() if vpn["type"] in ["vrf", "vpls"] else vpn["type"]
identity = "%s:%s" % (vpn["type"], identity)
# RFC2685 declares VPN ID as <IEEE OUI (3 octets)>:<VPN number (4 octets)
# Use reserved OUI range 00 00 00 - 00 00 FF to generate
./noc about
)
Paste NOC version (NOC version is: 20.1