X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=inline;f=sfa%2Ftrust%2Fhierarchy.py;h=0f3af465a43c15444ce45c2849d53550c196f0a6;hb=06b330f0ee047bdb107e43e82b1d7356c876bc15;hp=011890b75b1f43a227eb56c8951bdecd72a076c0;hpb=81e1ee491ab4f66145bef301fe7c4189d72df6e8;p=sfa.git diff --git a/sfa/trust/hierarchy.py b/sfa/trust/hierarchy.py index 011890b7..0f3af465 100644 --- a/sfa/trust/hierarchy.py +++ b/sfa/trust/hierarchy.py @@ -12,16 +12,13 @@ # *.DBINFO - database info ## -### $Id$ -### $URL$ - import os from sfa.util.sfalogging import sfa_logger +from sfa.util.xrn import get_leaf, get_authority, hrn_to_urn, urn_to_hrn from sfa.trust.certificate import Keypair -from sfa.trust.credential import * +from sfa.trust.credential import Credential from sfa.trust.gid import GID, create_uuid -from sfa.util.namespace import * from sfa.util.config import Config from sfa.util.sfaticket import SfaTicket @@ -161,7 +158,7 @@ class Hierarchy: def create_auth(self, xrn, create_parents=False): hrn, type = urn_to_hrn(xrn) - sfaImporter.logger.info("Hierarchy: creating authority: " + hrn) + sfa_logger().debug("Hierarchy: creating authority: " + hrn) # create the parent authority if necessary parent_hrn = get_authority(hrn) @@ -181,7 +178,7 @@ class Hierarchy: pass if os.path.exists(privkey_filename): - sfa_logger.debug("using existing key %r for authority %r"%(privkey_filename,hrn)) + sfa_logger().debug("using existing key %r for authority %r"%(privkey_filename,hrn)) pkey = Keypair(filename = privkey_filename) else: pkey = Keypair(create = True) @@ -205,10 +202,9 @@ class Hierarchy: # @param xrn the human readable name of the authority to create (urn will be converted to hrn). def get_auth_info(self, xrn): - - sfaImporter.logger.info("Hierarchy: getting authority: " + hrn) hrn, type = urn_to_hrn(xrn) if not self.auth_exists(hrn): + sfa_logger().warning("Hierarchy: mising authority - xrn=%s, hrn=%s"%(xrn,hrn)) raise MissingAuthority(hrn) (directory, gid_filename, privkey_filename, dbinfo_filename) = \