X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fnitos%2Fnitosdriver.py;h=8e3da348317c9b3f01d2c6126bb49e0757256852;hb=ecc85e0b923922cf7117d29b380f5284edb88f21;hp=da35ca3530ddb7ad8766c7280bef67205c967a21;hpb=1773871e724aa5d77c2b41a8bc8b0402742bab63;p=sfa.git diff --git a/sfa/nitos/nitosdriver.py b/sfa/nitos/nitosdriver.py index da35ca35..8e3da348 100644 --- a/sfa/nitos/nitosdriver.py +++ b/sfa/nitos/nitosdriver.py @@ -11,7 +11,6 @@ from sfa.util.xrn import Xrn, hrn_to_urn, get_leaf, urn_to_hrn 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 @@ -46,8 +45,9 @@ class NitosDriver (Driver): # 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() @@ -367,7 +367,7 @@ class NitosDriver (Driver): # 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. @@ -668,7 +668,7 @@ class NitosDriver (Driver): # xxx this code is quite old and has not run for ages # it is obviously totally broken and needs a rewrite def get_ticket (self, slice_urn, slice_hrn, creds, rspec_string, options): - raise SfaNotImplemented,"NitosDriver.get_ticket needs a rewrite" + raise SfaNotImplemented("NitosDriver.get_ticket needs a rewrite") # please keep this code for future reference # slices = PlSlices(self) # peer = slices.get_peer(slice_hrn)