- return
-
- # no ending, just one starting
- logger.log("'lease_or_shared' is xxx todo - would stop shared mode")
- # in lease_or_idle, all it takes is restart the sliver
- self.restart_slice (starting_lease['name'])
- return
+ self.suspend_slice(ending_lease['name'])
+ ########## something to start, nothing to end
+ elif starting_lease and not ending_lease:
+ self.restart_slice(starting_lease['name'])
+ # with the lease_or_shared policy, this is mandatory
+ # otherwise it's just safe
+ self.suspend_all_slices(exclude=starting_lease['name'])
+ ########## so now, something to end, nothing to start
+ else:
+ self.suspend_slice (ending_lease['name'])
+ if self.reservation_policy=='lease_or_shared':
+ logger.log("reservation.granularity_callback: 'lease_or_shared' not implemented - using 'lease_or_idle'")
+ # only lease_or_idle policy available for now: we freeze the box
+ logger.log("reservation.granularity_callback: suspending all slices")
+ self.suspend_all_slices()