| @@ 1449-1477 (lines=29) @@ | ||
| 1446 | self.notify_link_status_change(link, interrupt_type) |
|
| 1447 | self.notify_topology_update() |
|
| 1448 | ||
| 1449 | def handle_interruption_end(self, event: KytosEvent): |
|
| 1450 | """Deals with the end of service interruption.""" |
|
| 1451 | interrupt_type = event.content['type'] |
|
| 1452 | switches = event.content.get('switches', []) |
|
| 1453 | interfaces = event.content.get('interfaces', []) |
|
| 1454 | links = event.content.get('links', []) |
|
| 1455 | log.info( |
|
| 1456 | 'Received interruption end of type \'%s\' ' |
|
| 1457 | 'affecting switches %s, interfaces %s, links %s', |
|
| 1458 | interrupt_type, |
|
| 1459 | switches, |
|
| 1460 | interfaces, |
|
| 1461 | links |
|
| 1462 | ) |
|
| 1463 | # for switch_id in switches: |
|
| 1464 | # pass |
|
| 1465 | # for interface_id in interfaces: |
|
| 1466 | # pass |
|
| 1467 | for link_id in links: |
|
| 1468 | link = self.links.get(link_id) |
|
| 1469 | if link is None: |
|
| 1470 | log.error( |
|
| 1471 | "Invalid link id '%s' for interruption of type '%s;", |
|
| 1472 | link_id, |
|
| 1473 | interrupt_type |
|
| 1474 | ) |
|
| 1475 | else: |
|
| 1476 | self.notify_link_status_change(link, interrupt_type) |
|
| 1477 | self.notify_topology_update() |
|
| 1478 | ||
| @@ 1419-1447 (lines=29) @@ | ||
| 1416 | elif interrupt_type == "end": |
|
| 1417 | self.handle_interruption_end(event) |
|
| 1418 | ||
| 1419 | def handle_interruption_start(self, event: KytosEvent): |
|
| 1420 | """Deals with the start of service interruption.""" |
|
| 1421 | interrupt_type = event.content['type'] |
|
| 1422 | switches = event.content.get('switches', []) |
|
| 1423 | interfaces = event.content.get('interfaces', []) |
|
| 1424 | links = event.content.get('links', []) |
|
| 1425 | log.info( |
|
| 1426 | 'Received interruption start of type \'%s\' ' |
|
| 1427 | 'affecting switches %s, interfaces %s, links %s', |
|
| 1428 | interrupt_type, |
|
| 1429 | switches, |
|
| 1430 | interfaces, |
|
| 1431 | links |
|
| 1432 | ) |
|
| 1433 | # for switch_id in switches: |
|
| 1434 | # pass |
|
| 1435 | # for interface_id in interfaces: |
|
| 1436 | # pass |
|
| 1437 | for link_id in links: |
|
| 1438 | link = self.links.get(link_id) |
|
| 1439 | if link is None: |
|
| 1440 | log.error( |
|
| 1441 | "Invalid link id '%s' for interruption of type '%s;", |
|
| 1442 | link_id, |
|
| 1443 | interrupt_type |
|
| 1444 | ) |
|
| 1445 | else: |
|
| 1446 | self.notify_link_status_change(link, interrupt_type) |
|
| 1447 | self.notify_topology_update() |
|
| 1448 | ||
| 1449 | def handle_interruption_end(self, event: KytosEvent): |
|
| 1450 | """Deals with the end of service interruption.""" |
|