X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2FResolve.py;h=f3a6e67135497c3704dc439e03402058ce312953;hb=1cc8e9613cab8b5b22478de369f259e591c54e6d;hp=094500f040038464279374db4736bdc2c4ec9892;hpb=29df906cd2d154a3b90fcb1b7025f3fc1bb577fe;p=sfa.git diff --git a/sfa/methods/Resolve.py b/sfa/methods/Resolve.py index 094500f0..f3a6e671 100644 --- a/sfa/methods/Resolve.py +++ b/sfa/methods/Resolve.py @@ -2,9 +2,10 @@ import types from sfa.util.xrn import Xrn, urn_to_hrn from sfa.util.method import Method -from sfa.util.parameter import Parameter, Mixed + from sfa.trust.credential import Credential -from sfa.util.record import SfaRecord + +from sfa.storage.parameter import Parameter, Mixed class Resolve(Method): """ @@ -17,16 +18,23 @@ class Resolve(Method): interfaces = ['registry'] + # should we not accept an optional 'details' argument ? accepts = [ Mixed(Parameter(str, "Human readable name (hrn or urn)"), Parameter(list, "List of Human readable names ([hrn])")), Mixed(Parameter(str, "Credential string"), - Parameter(list, "List of credentials)")) + Parameter(list, "List of credentials)")), + Parameter(dict, "options"), ] - returns = [SfaRecord] + # xxx used to be [SfaRecord] + returns = [Parameter(dict, "registry record")] - def call(self, xrns, creds): + def call(self, xrns, creds, options={}): + # use details=False by default, only when explicitly specified do we want + # to mess with the testbed details + if 'details' in options: details=options['details'] + else: details=False type = None if not isinstance(xrns, types.ListType): type = Xrn(xrns).get_type() @@ -40,5 +48,5 @@ class Resolve(Method): self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, hrns, self.name)) # send the call to the right manager - return self.api.manager.Resolve(self.api, xrns, type) + return self.api.manager.Resolve(self.api, xrns, type, details=details)