Skip to content

Commit

Permalink
Merge pull request #116 from kytos-ng/fix/load_inactive
Browse files Browse the repository at this point in the history
[Fix] Load interfaces as inactive
  • Loading branch information
viniarck committed Dec 6, 2022
2 parents 4b578f6 + 6145a53 commit d036b97
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Removed
Fixed
=====
- Fixed link up to only notify when ``LINK_UP_TIMER`` has passed
- Load interfaces as inactive

Security
========
Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def _load_switch(self, switch_id, switch_att):
interface.disable()
interface.lldp = iface_att['lldp']
interface.extend_metadata(iface_att["metadata"])
interface.deactivate()
name = 'kytos/topology.port.created'
event = KytosEvent(name=name, content={
'switch': switch_id,
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ def test_load_switch(self, *args):
'interfaces': {
iface_a: {
'enabled': True,
'active': True,
'lldp': True,
'id': iface_a,
'switch': dpid_a,
Expand Down Expand Up @@ -398,6 +399,7 @@ def test_load_switch(self, *args):
self.assertEqual(interface.switch.id, dpid_a)
self.assertEqual(interface.port_number, 1)
self.assertTrue(interface.is_enabled())
self.assertFalse(interface.is_active())
self.assertTrue(interface.lldp)
self.assertTrue(interface.uni)
self.assertFalse(interface.nni)
Expand Down

0 comments on commit d036b97

Please sign in to comment.