X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=blobdiff_plain;f=sfa%2Fmethods%2FGetSelfCredential.py;h=a528cb14eed1f5ea0ba7f8eace033abbe0b9b068;hp=385d501fce511eb8751cfef6a6e23ce963080f20;hb=fd395e1944dcd49f10a4d5b27ce4983ad389fb96;hpb=04a3f20dc71bf8b3f96b1e3172623aa346a638a7 diff --git a/sfa/methods/GetSelfCredential.py b/sfa/methods/GetSelfCredential.py index 385d501f..a528cb14 100644 --- a/sfa/methods/GetSelfCredential.py +++ b/sfa/methods/GetSelfCredential.py @@ -1,6 +1,7 @@ from sfa.util.faults import RecordNotFound, ConnectionKeyGIDMismatch from sfa.util.xrn import urn_to_hrn from sfa.util.method import Method +from sfa.util.sfalogging import logger from sfa.trust.certificate import Certificate @@ -10,11 +11,11 @@ from sfa.storage.parameter import Parameter, Mixed class GetSelfCredential(Method): """ Retrive a credential for an object - @param cert certificate string + @param cert certificate string @param type type of object (user | slice | sa | ma | node) @param hrn human readable name of object (hrn or urn) - @return the string representation of a credential object + @return the string representation of a credential object """ interfaces = ['registry'] @@ -51,8 +52,8 @@ class GetSelfCredential(Method): self.api.auth.verify_object_belongs_to_me(hrn) origin_hrn = Certificate(string=cert).get_subject() - self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s" % - (self.api.interface, origin_hrn, hrn, self.name)) + logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s" % + (self.api.interface, origin_hrn, hrn, self.name)) # authenticate the gid # import here so we can load this module at build-time for sfa2wsdl @@ -78,12 +79,12 @@ class GetSelfCredential(Method): certificate = Certificate(string=cert) if not certificate.is_pubkey(gid.get_pubkey()): for (obj, name) in [(certificate, "CERT"), (gid, "GID"), ]: - self.api.logger.debug("ConnectionKeyGIDMismatch, %s pubkey: %s" % ( + logger.debug("ConnectionKeyGIDMismatch, %s pubkey: %s" % ( name, obj.get_pubkey().get_pubkey_string())) - self.api.logger.debug( + logger.debug( "ConnectionKeyGIDMismatch, %s dump: %s" % (name, obj.dump_string())) if hasattr(obj, 'filename'): - self.api.logger.debug( + logger.debug( "ConnectionKeyGIDMismatch, %s filename: %s" % (name, obj.filename)) raise ConnectionKeyGIDMismatch(gid.get_subject())