blob: 17d36f2043b2954047b795a23907d95313681350 [file] [log] [blame]
Andy Bavier89a95422016-11-02 14:38:39 -04001
Matteo Scandolof5e10332017-08-08 13:05:25 -07002# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
17
Andy Bavier89a95422016-11-02 14:38:39 -040018def handle(instance):
19 from core.models import Controller, ControllerSlice, ControllerNetwork, NetworkSlice
20
21 networks = [ns.network for ns in NetworkSlice.objects.filter(slice=instance.slice)]
22 controller_networks = ControllerNetwork.objects.filter(network__in=networks,
23 controller=instance.node.site_deployment.controller)
24
25 for cn in controller_networks:
26 if (cn.lazy_blocked):
27 cn.lazy_blocked=False
28 cn.backend_register = '{}'
29 cn.save()