from sfa.util.xrn import Xrn, urn_to_hrn
from sfa.util.method import Method
from sfa.util.xrn import Xrn, urn_to_hrn
from sfa.util.method import Method
# 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"),
# 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"),
+ ]
# xxx used to be [SfaRecord]
returns = [Parameter(dict, "registry record")]
# xxx used to be [SfaRecord]
returns = [Parameter(dict, "registry record")]
-
- def call(self, xrns, creds):
- # xxx should be ar arg
- details=False
+
+ def call(self, xrns, creds, options=None):
+ if options is None:
+ 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
- #log the call
- origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
- self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, hrns, self.name))
-
+ # log the call
+ origin_hrn = Credential(
+ string=valid_creds[0]).get_gid_caller().get_hrn()
+ 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, details=details)
# send the call to the right manager
return self.api.manager.Resolve(self.api, xrns, type, details=details)