Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/bug: operational changes isn't considering status and status_reason #74

Open
viniarck opened this issue Nov 7, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@viniarck
Copy link
Collaborator

viniarck commented Nov 7, 2024

Currently, topology updates of switch/link/interface is only considering is_active(). But, on kytos-ng status_reason can also have logical states which represents a non operational state. For instance, maintenance, liveness all of these logical interruptions (liveness doesn't use actual interruptions yet, but equivalent approach), they can represent that a given entity isn't operationally available.

If you guys also expect for this to reflect accordingly you might want to also check if status_reason isn't empty, and to be safe only consider something active if status is also UP.

Here's an example with maintenance (notice active True, but status_reason not empty and status not UP):

kytos $> controller.napps[('kytos', 'topology')].links[link_id].as_dict()
Out[4]: 
{'id': 'c8b55359990f89a5849813dc348d30e9e1f991bad1dcb7f82112bd35429d9b07',
 'endpoint_a': {'id': '00:00:00:00:00:00:00:03:3',
  'name': 's3-eth3',
  'port_number': 3,
  'mac': '3e:ba:af:c8:aa:78',
  'switch': '00:00:00:00:00:00:00:03',
  'type': 'interface',
  'nni': True,
  'uni': False,
  'speed': 1250000000.0,
  'metadata': {},
  'lldp': True,
  'active': True,
  'enabled': True,
  'status': 'UP',
  'status_reason': [],
  'link': 'c8b55359990f89a5849813dc348d30e9e1f991bad1dcb7f82112bd35429d9b07'},
 'endpoint_b': {'id': '00:00:00:00:00:00:00:01:4',
  'name': 's1-eth4',
  'port_number': 4,
  'mac': '8e:c9:21:41:52:92',
  'switch': '00:00:00:00:00:00:00:01',
  'type': 'interface',
  'nni': True,
  'uni': False,
  'speed': 1250000000.0,
  'metadata': {},
  'lldp': True,
  'active': True,
  'enabled': True,
  'status': 'UP',
  'status_reason': [],
  'link': 'c8b55359990f89a5849813dc348d30e9e1f991bad1dcb7f82112bd35429d9b07'},
 'metadata': {'last_status_change': 1730992501.1578355,
  'last_status_is_active': True,
  'notified_up_at': datetime.datetime(2024, 11, 7, 15, 15, 11, 172970, tzinfo=datetime.timezone.utc)},
 'active': True,
 'enabled': True,
 'status': 'DOWN',
 'status_reason': ['maintenance']}
@viniarck viniarck added bug Something isn't working enhancement New feature or request labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant