@@ -201,11 +201,12 @@ def _clean_property(property):
201201
202202 @staticmethod
203203 # CF.Properties and dict() of { 'id': value, ... }
204- def _get_prop_changes (current_props , new_properties ):
204+ # Use force to treat all ID matches as required changes
205+ def _get_prop_changes (current_props , new_properties , force = False ):
205206 changes = {}
206207 for prop in current_props :
207208 if prop .id in new_properties :
208- if new_properties [prop .id ] != prop .queryValue ():
209+ if new_properties [prop .id ] != prop .queryValue () or force :
209210 changes [str (prop .id )] = prop .fromAny (
210211 prop .toAny (
211212 Redhawk ._clean_property (new_properties [prop .id ])
@@ -279,7 +280,7 @@ def device_configure(self, domain_name, device_manager_id, device_id, new_proper
279280 @background_task
280281 def device_allocate (self , domain_name , device_manager_id , device_id , new_properties ):
281282 dev = self ._get_device (domain_name , device_manager_id , device_id )
282- changes = Redhawk ._get_prop_changes (dev ._properties , new_properties )
283+ changes = Redhawk ._get_prop_changes (dev ._properties , new_properties , True )
283284 try :
284285 return dev .allocateCapacity (changes ), ''
285286 except Exception as e :
@@ -288,9 +289,10 @@ def device_allocate(self, domain_name, device_manager_id, device_id, new_propert
288289 @background_task
289290 def device_deallocate (self , domain_name , device_manager_id , device_id , new_properties ):
290291 dev = self ._get_device (domain_name , device_manager_id , device_id )
291- changes = Redhawk ._get_prop_changes (dev ._properties , new_properties )
292+ changes = Redhawk ._get_prop_changes (dev ._properties , new_properties , True )
292293 try :
293- return dev .deallocateCapacity (changes ), ''
294+ dev .deallocateCapacity (changes )
295+ return True , ''
294296 except Exception as e :
295297 return False , "{0}" .format (e );
296298
0 commit comments