blob: f4fab5810398b06dfcaff42199cf4336812bde31 [file] [log] [blame]
Scott Bakeraf599eb2017-03-21 12:43:26 -07001from synchronizers.new_base.modelaccessor import *
2
Scott Bakerb63ea792016-08-11 10:24:48 -07003def handle(slice_privilege):
Scott Bakeraf599eb2017-03-21 12:43:26 -07004 # slice_privilege = SlicePrivilege.get(slice_privilege_id)
Scott Bakerb63ea792016-08-11 10:24:48 -07005 # apply slice privilage at all controllers
6 controller_slice_privileges = ControllerSlicePrivilege.objects.filter(
7 slice_privilege = slice_privilege,
8 )
9 existing_controllers = [sp.controller for sp in controller_slice_privileges]
10 all_controllers = Controller.objects.all()
11 for controller in all_controllers:
12 if controller not in existing_controllers:
13 ctrl_slice_priv = ControllerSlicePrivilege(controller=controller, slice_privilege=slice_privilege)
14 ctrl_slice_priv.save()
15