continue
rspec_node = self.sliver_to_rspec_node(sliver, sites, interfaces, node_tags, pl_initscripts)
geni_sliver = self.rspec_node_to_geni_sliver(rspec_node)
- sliver_allocation = sliver_allocation_dict[sliver['sliver_id']]
- geni_sliver['geni_allocation_status'] = sliver_allocation.allocation_state
+ sliver_allocation_record = sliver_allocation_dict.get(sliver['sliver_id'])
+ if sliver_allocation_record:
+ sliver_allocation = sliver_allocation.allocation_state
+ else:
+ sliver_allocation = 'geni_unallocated'
+ geni_sliver['geni_allocation_status'] = sliver_allocation
rspec_nodes.append(rspec_node)
geni_slivers.append(geni_sliver)
rspec.version.add_nodes(rspec_nodes)
constraint = SliverAllocation.sliver_id.in_(sliver_ids)
cur_sliver_allocations = dbsession.query(SliverAllocation).filter(constraint)
for sliver_allocation in cur_sliver_allocations:
- sliver_allocation.allocation_state = 'geni_unallocated'
+ dbsession.delete(sliver_allocation)
dbsession.commit()
finally:
if peer:
self.shell.BindObjectToPeer('slice', slice_id, peer, slice['peer_slice_id'])
-
-
# prepare return struct
geni_slivers = []
for node_id in node_ids: