from sfa.util.cache import Cache
# 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
# used to be used in get_ticket
# the cache instance is a class member so it survives across incoming requests
cache = None
- def __init__ (self, config):
- Driver.__init__ (self, config)
+ def __init__ (self, api):
+ Driver.__init__ (self, api)
+ config = api.config
self.shell = NitosShell (config)
self.cache=None
self.testbedInfo = self.shell.getTestbedInfo()
# get the registry records
user_list, users = [], {}
- user_list = dbsession.query(RegRecord).filter(RegRecord.pointer.in_(user_ids)).all()
+ user_list = self.api.dbsession().query(RegRecord).filter(RegRecord.pointer.in_(user_ids)).all()
# create a hrns keyed on the sfa record's pointer.
# Its possible for multiple records to have the same pointer so
# the dict's value will be a list of hrns.
for lease in rspec_requested_leases:
if lease['type'] == 'node':
lease.pop('type', None)
- rspec_requested_nodes = lease
+ rspec_requested_nodes.append(lease)
else:
lease.pop('type', None)
- rspec_requested_channels = lease
+ rspec_requested_channels.append(lease)
nodes = slices.verify_slice_leases_nodes(slice, rspec_requested_nodes)
channels = slices.verify_slice_leases_channels(slice, rspec_requested_channels)