git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add 'url' field to the authority record
[sfa.git]
/
sfa
/
trust
/
hierarchy.py
diff --git
a/sfa/trust/hierarchy.py
b/sfa/trust/hierarchy.py
index
4678964
..
5d7db6f
100644
(file)
--- a/
sfa/trust/hierarchy.py
+++ b/
sfa/trust/hierarchy.py
@@
-12,16
+12,14
@@
# *.DBINFO - database info
##
# *.DBINFO - database info
##
-### $Id$
-### $URL$
-
import os
import os
+from sfa.util.faults import *
from sfa.util.sfalogging import sfa_logger
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.certificate import Keypair
-from sfa.trust.credential import
*
+from sfa.trust.credential import
Credential
from sfa.trust.gid import GID, create_uuid
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
from sfa.util.config import Config
from sfa.util.sfaticket import SfaTicket
@@
-161,7
+159,7
@@
class Hierarchy:
def create_auth(self, xrn, create_parents=False):
hrn, type = urn_to_hrn(xrn)
def create_auth(self, xrn, create_parents=False):
hrn, type = urn_to_hrn(xrn)
- sfa_logger
.debug("Hierarchy: creating authority: " +
hrn)
+ sfa_logger
().debug("Hierarchy: creating authority: %s"%
hrn)
# create the parent authority if necessary
parent_hrn = get_authority(hrn)
# create the parent authority if necessary
parent_hrn = get_authority(hrn)
@@
-181,7
+179,7
@@
class Hierarchy:
pass
if os.path.exists(privkey_filename):
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)
pkey = Keypair(filename = privkey_filename)
else:
pkey = Keypair(create = True)
@@
-206,8
+204,8
@@
class Hierarchy:
def get_auth_info(self, xrn):
hrn, type = urn_to_hrn(xrn)
def get_auth_info(self, xrn):
hrn, type = urn_to_hrn(xrn)
- sfa_logger.debug("Hierarchy: getting authority: " + hrn)
if not self.auth_exists(hrn):
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) = \
raise MissingAuthority(hrn)
(directory, gid_filename, privkey_filename, dbinfo_filename) = \