X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Ftrust%2Fhierarchy.py;h=f28329ce106f6940369b12a5a2942d9d1503bcc6;hb=3eea82897aba845da0d12c1ba56012e599f58853;hp=1ba7fb11e2b89574c6d7714f798166f0590423e2;hpb=0cf0d31c313a366e3f272f830bdb4f2a7308e11f;p=sfa.git diff --git a/sfa/trust/hierarchy.py b/sfa/trust/hierarchy.py index 1ba7fb11..f28329ce 100644 --- a/sfa/trust/hierarchy.py +++ b/sfa/trust/hierarchy.py @@ -12,17 +12,14 @@ # *.DBINFO - database info ## -### $Id$ -### $URL$ - import os -from sfa.util.sfalogging import sfa_logger -from sfa.util.report import * +from sfa.util.faults import * +from sfa.util.sfalogging import 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 @@ -36,7 +33,6 @@ class AuthInfo: gid_filename = None privkey_filename = None dbinfo_filename = None - ## # Initialize and authority object. # @@ -162,7 +158,7 @@ class Hierarchy: def create_auth(self, xrn, create_parents=False): hrn, type = urn_to_hrn(xrn) - trace("Hierarchy: creating authority: " + hrn) + logger.debug("Hierarchy: creating authority: %s"% hrn) # create the parent authority if necessary parent_hrn = get_authority(hrn) @@ -182,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)) + logger.debug("using existing key %r for authority %r"%(privkey_filename,hrn)) pkey = Keypair(filename = privkey_filename) else: pkey = Keypair(create = True) @@ -206,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): - - #trace("Hierarchy: getting authority: " + hrn) hrn, type = urn_to_hrn(xrn) if not self.auth_exists(hrn): + logger.warning("Hierarchy: mising authority - xrn=%s, hrn=%s"%(xrn,hrn)) raise MissingAuthority(hrn) (directory, gid_filename, privkey_filename, dbinfo_filename) = \