+
+ # add/remove leases
+ requested_leases = []
+ kept_leases = []
+ for lease in rspec.version.get_leases():
+ requested_lease = {}
+ if not lease.get('lease_id'):
+ requested_lease['hostname'] = xrn_to_hostname(lease.get('component_id').strip())
+ requested_lease['t_from'] = lease.get('t_from')
+ requested_lease['t_until'] = lease.get('t_until')
+ else:
+ kept_leases.append(int(lease['lease_id']))
+ if requested_lease.get('hostname'):
+ requested_leases.append(requested_lease)
+
+ leases = slices.verify_slice_leases(slice, requested_leases, kept_leases, peer)