-### $Id: resolve.py 17157 2010-02-21 04:19:34Z tmack $
-### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/methods/resolve.py $
-import traceback
import types
-from sfa.util.faults import *
-from sfa.util.xrn import urn_to_hrn
+
+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):
"""
Parameter(list, "List of credentials)"))
]
- returns = [SfaRecord]
+ # xxx used to be [SfaRecord]
+ returns = [Parameter(dict, "registry record")]
def call(self, xrns, creds):
+ type = None
if not isinstance(xrns, types.ListType):
+ type = Xrn(xrns).get_type()
xrns=[xrns]
hrns = [urn_to_hrn(xrn)[0] for xrn in xrns]
- #test
- #test2
- #test tmack
#find valid credentials
valid_creds = self.api.auth.checkCredentials(creds, 'resolve')
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
- manager = self.api.get_interface_manager()
- return manager.resolve(self.api, xrns)
-
-
+ return self.api.manager.Resolve(self.api, xrns, type)