# one would think the driver should not need to mess with the SFA db, but..
from sfa.storage.alchemy import dbsession
from sfa.storage.model import RegRecord, SliverAllocation
+from sfa.trust.credential import Credential
# used to be used in get_ticket
#from sfa.trust.sfaticket import SfaTicket
def sliver_to_slice_xrn(self, xrn):
sliver_id_parts = Xrn(xrn).get_sliver_id_parts()
- slices = self.shell.GetSlices(sliver_id_parts[0])
+ slice_id = int(sliver_id_parts[0])
+ slices = self.shell.GetSlices(slice_id)
if not slices:
raise Forbidden("Unable to locate slice record for sliver: %s" % xrn)
slice = slices[0]
- slice_xrn = Xrn(auth=self.hrn, slicename=slice['name'])
+ slice_xrn = PlXrn(auth=self.hrn, slicename=slice['name'])
return slice_xrn
def check_sliver_credentials(self, creds, urns):
slice_cred_hrn = Credential(cred=cred).get_gid_object().get_hrn()
slice_cred_names.append(PlXrn(xrn=slice_cred_hrn).pl_slicename())
- # look slice names of slivers listed in urns arg
+ # look up slice name of slivers listed in urns arg
slice_ids = []
for urn in urns:
sliver_id_parts = Xrn(xrn=urn).get_sliver_id_parts()
'geni_slivers': desc['geni_slivers']}
return status
- def allocate (self, urn, rspec_string, options={}):
+ def allocate (self, urn, rspec_string, expiration, options={}):
xrn = Xrn(urn)
aggregate = PlAggregate(self)
slices = PlSlices(self)
# ensure site record exists
site = slices.verify_site(xrn.hrn, slice_record, peer, sfa_peer, options=options)
# ensure slice record exists
- slice = slices.verify_slice(xrn.hrn, slice_record, peer, sfa_peer, options=options)
+ slice = slices.verify_slice(xrn.hrn, slice_record, peer, sfa_peer, expiration=expiration, options=options)
# ensure person records exists
persons = slices.verify_persons(xrn.hrn, slice, users, peer, sfa_peer, options=options)
# ensure slice attributes exists
# add/remove slice from nodes
request_nodes = rspec.version.get_nodes_with_slivers()
- nodes = slices.verify_slice_nodes(slice, request_nodes, peer)
+ nodes = slices.verify_slice_nodes(urn, slice, request_nodes, peer)
# add/remove links links
slices.verify_slice_links(slice, rspec.version.get_link_requests(), nodes)