Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
N
noc
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 447
    • Issues 447
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 37
    • Merge Requests 37
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • noc
  • noc
  • Issues
  • #1312

Closed
Open
Opened Jun 05, 2020 by Reinhard Sax@cc-saxr

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

Paste NOC version (./noc about)

NOC version is: 20.1

Assignee
Assign to
20.4
Milestone
20.4 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: noc/noc#1312