Skip to content

Commit

Permalink
Associate checkpoint VLAN interfaces with VLANs
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Nov 1, 2023
1 parent e879e67 commit fc4402b
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
@@ -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
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 fc4402b

Please sign in to comment.