X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2FGetTicket.py;h=14696931da57c6f35fd7e94b8397a692669c5428;hb=57b6a99255d4a88be9c0f910f8524677e34ff4bc;hp=7d99e9fd363f75486a3c1e601d137eb9db3f0c26;hpb=680d4fc1af88ed631f820545216bee6e7a698f39;p=sfa.git diff --git a/sfa/methods/GetTicket.py b/sfa/methods/GetTicket.py index 7d99e9fd..14696931 100644 --- a/sfa/methods/GetTicket.py +++ b/sfa/methods/GetTicket.py @@ -1,15 +1,10 @@ -### $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.namespace 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 + class GetTicket(Method): """ Retrieve a ticket. This operation is currently implemented on PLC @@ -34,17 +29,15 @@ class GetTicket(Method): Mixed(Parameter(str, "Credential string"), Parameter(type([str]), "List of credentials")), Parameter(str, "Resource specification (rspec)"), - Mixed(Parameter(str, "Human readable name of the original caller"), - Parameter(None, "Origin hrn not specified")), Parameter(type([]), "List of user information") ] - returns = Parameter(str, "String represeneation of a ticket object") + returns = Parameter(str, "String representation of a ticket object") def call(self, xrn, creds, rspec, users): hrn, type = urn_to_hrn(xrn) # Find the valid credentials - valid_creds = self.api.auth.checkCredentials(creds, 'createsliver', hrn) + valid_creds = self.api.auth.checkCredentials(creds, 'getticket', hrn) origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn() #log the call @@ -52,7 +45,7 @@ class GetTicket(Method): manager = self.api.get_interface_manager() - # flter rspec through sfatables + # filter rspec through sfatables if self.api.interface in ['aggregate']: chain_name = 'OUTGOING' elif self.api.interface in ['slicemgr']: