Scott Baker | af599eb | 2017-03-21 12:43:26 -0700 | [diff] [blame] | 1 | from synchronizers.new_base.modelaccessor import * |
Scott Baker | b63ea79 | 2016-08-11 10:24:48 -0700 | [diff] [blame] | 2 | |
| 3 | def handle(instance): |
Scott Baker | af599eb | 2017-03-21 12:43:26 -0700 | [diff] [blame] | 4 | networks = [ns.network for ns in NetworkSlice.objects.filter(slice_id=instance.slice.id)] |
| 5 | network_ids = [x.id for x in networks] |
| 6 | controller_networks = ControllerNetwork.objects.filter(controller_id=instance.node.site_deployment.controller.id) |
| 7 | controller_networks = [x for x in controller_networks if x.network_id in network_ids] |
Scott Baker | b63ea79 | 2016-08-11 10:24:48 -0700 | [diff] [blame] | 8 | |
| 9 | for cn in controller_networks: |
| 10 | if (cn.lazy_blocked): |
| 11 | cn.lazy_blocked=False |
| 12 | cn.backend_register = '{}' |
| 13 | cn.save() |