X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2FGetTicket.py;h=2223e3738d3712e6ea40d4ee097395a5bb305ac5;hb=cf630d87d633f3861e3ac8a50433fa29ca46a74e;hp=e175cfe93d7b5c29e3d460dd660db88391cc07de;hpb=5f4f788db1dd59e8a5968e9118ff1feda89389dc;p=sfa.git diff --git a/sfa/methods/GetTicket.py b/sfa/methods/GetTicket.py index e175cfe9..2223e373 100644 --- a/sfa/methods/GetTicket.py +++ b/sfa/methods/GetTicket.py @@ -1,15 +1,11 @@ -### $Id: get_ticket.py 17732 2010-04-19 21:10:45Z tmack $ -### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/methods/get_ticket.py $ -import time -from sfa.util.faults import * from sfa.util.xrn import urn_to_hrn from sfa.util.method import Method -from sfa.util.parameter import Parameter, Mixed -from sfa.trust.auth import Auth -from sfa.util.config import Config -from sfa.trust.credential import Credential from sfa.util.sfatablesRuntime import run_sfatables +from sfa.trust.credential import Credential + +from sfa.storage.parameter import Parameter, Mixed + class GetTicket(Method): """ Retrieve a ticket. This operation is currently implemented on PLC @@ -34,12 +30,13 @@ class GetTicket(Method): Mixed(Parameter(str, "Credential string"), Parameter(type([str]), "List of credentials")), Parameter(str, "Resource specification (rspec)"), - Parameter(type([]), "List of user information") + Parameter(type([]), "List of user information"), + Parameter(dict, "Options") ] returns = Parameter(str, "String representation of a ticket object") - def call(self, xrn, creds, rspec, users): + def call(self, xrn, creds, rspec, users, options={}): hrn, type = urn_to_hrn(xrn) # Find the valid credentials valid_creds = self.api.auth.checkCredentials(creds, 'getticket', hrn) @@ -48,8 +45,6 @@ class GetTicket(Method): #log the call self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, hrn, self.name)) - manager = self.api.get_interface_manager() - # filter rspec through sfatables if self.api.interface in ['aggregate']: chain_name = 'OUTGOING' @@ -58,7 +53,5 @@ class GetTicket(Method): rspec = run_sfatables(chain_name, hrn, origin_hrn, rspec) # remove nodes that are not available at this interface from the rspec - ticket = manager.get_ticket(self.api, xrn, creds, rspec, users) - - return ticket + return self.api.manager.GetTicket(self.api, xrn, creds, rspec, users, options)