X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2Fget_trusted_certs.py;h=53a687f36cd1efa8e20a8fe9d5045614b2b9d814;hb=04a3f20dc71bf8b3f96b1e3172623aa346a638a7;hp=704fd429329f89c19176560038ca52fa0f5744a6;hpb=a84a9f560f623d7500622e275426ae0e12332a03;p=sfa.git diff --git a/sfa/methods/get_trusted_certs.py b/sfa/methods/get_trusted_certs.py index 704fd429..53a687f3 100644 --- a/sfa/methods/get_trusted_certs.py +++ b/sfa/methods/get_trusted_certs.py @@ -1,9 +1,10 @@ -from sfa.util.faults import * from sfa.util.method import Method -from sfa.util.parameter import Parameter, Mixed + from sfa.trust.auth import Auth from sfa.trust.credential import Credential +from sfa.storage.parameter import Parameter, Mixed + class get_trusted_certs(Method): """ @@ -12,29 +13,29 @@ class get_trusted_certs(Method): """ interfaces = ['registry', 'aggregate', 'slicemgr'] - + accepts = [ Mixed(Parameter(str, "Credential string"), Parameter(None, "Credential not specified")) - ] + ] returns = Parameter(type([str]), "List of GID strings") - - def call(self, cred = None): + + def call(self, cred=None): # If cred is not specified just return the gid for this interface. # This is true when when a peer is attempting to initiate federation - # with this interface - self.api.logger.debug("get_trusted_certs: %r"%cred) + # with this interface + self.api.logger.debug("get_trusted_certs: %r" % cred) if not cred: gid_strings = [] for gid in self.api.auth.trusted_cert_list: if gid.get_hrn() == self.api.config.SFA_INTERFACE_HRN: - gid_strings.append(gid.save_to_string(save_parents=True)) + gid_strings.append(gid.save_to_string(save_parents=True)) return gid_strings # authenticate the cred self.api.auth.check(cred, 'gettrustedcerts') - gid_strings = [gid.save_to_string(save_parents=True) for \ - gid in self.api.auth.trusted_cert_list] - - return gid_strings + gid_strings = [gid.save_to_string(save_parents=True) for + gid in self.api.auth.trusted_cert_list] + + return gid_strings