blob: 3c6d54f62e6d39b7ef4bf92d39c7c4b9c67a8d6b [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(controller_slice):
Scott Bakerb63ea792016-08-11 10:24:48 -07004 try:
5 my_status_code = int(controller_slice.backend_status[0])
6 try:
7 his_status_code = int(controller_slice.slice.backend_status[0])
8 except:
9 his_status_code = 0
10
11 fields = []
12 if (my_status_code not in [0,his_status_code]):
13 controller_slice.slice.backend_status = controller_slice.backend_status
14 fields+=['backend_status']
15
16 if (controller_slice.backend_register != controller_slice.slice.backend_register):
17 controller_slice.slice.backend_register = controller_slice.backend_register
18 fields+=['backend_register']
19
20 controller_slice.slice.save(update_fields = fields)
21
22
23 except Exception,e:
24 print str(e)
25 pass