Skip to content

Commit

Permalink
Merge pull request #2701 from johannaengland/vlan-patterns-checkpoint
Browse files Browse the repository at this point in the history
Associate checkpoint VLAN interfaces with VLANs
  • Loading branch information
johannaengland authored Nov 1, 2023
2 parents e879e67 + fc4402b commit a5d5319
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/nav/ipdevpoll/plugins/prefix.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2008-2012 Uninett AS
# Copyright (C) 2022 Sikt
# Copyright (C) 2022-2023 Sikt
#
# This file is part of Network Administration Visualized (NAV).
#
Expand Down Expand Up @@ -51,7 +51,7 @@
from nav.ipdevpoll import shadows

VLAN_PATTERN = re.compile(
r"(Vl(an)?|irb\.|reth\d+\.)(?P<vlan>\d+)",
r"(Vl(an)?|irb\.|reth\d+\.|bond\d+\.)(?P<vlan>\d+)",
re.IGNORECASE,
)

Expand Down
5 changes: 5 additions & 0 deletions tests/unittests/ipdevpoll/prefix_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ def test_cisco_short_names_should_match(self):

def test_juniper_irb_names_should_match(self):
match = prefix.VLAN_PATTERN.match("irb." + self.vlan)
self.assertEqual(match.group('vlan'), self.vlan)

def test_juniper_reth_names_should_match(self):
match = prefix.VLAN_PATTERN.match("reth0." + self.vlan)
self.assertEqual(match.group('vlan'), self.vlan)

def test_checkpoint_vlan_names_should_match(self):
match = prefix.VLAN_PATTERN.match("bond0." + self.vlan)
self.assertEqual(match.group('vlan'), self.vlan)

0 comments on commit a5d5319

Please sign in to comment.