From: Anil-Kumar Vengalil Date: Mon, 30 Nov 2009 15:57:12 +0000 (+0000) Subject: ensruing that trusted_root directory is present and holds root gids X-Git-Tag: sfa-0.9-7~285 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=151ecb656399f0b67e10ced88e2c3867e764857a ensruing that trusted_root directory is present and holds root gids --- diff --git a/sfa/trust/auth.py b/sfa/trust/auth.py index b1db32aa..b2788fa3 100644 --- a/sfa/trust/auth.py +++ b/sfa/trust/auth.py @@ -60,6 +60,8 @@ class Auth: self.client_gid.verify_chain(self.trusted_cert_list) if self.object_gid: self.object_gid.verify_chain(self.trusted_cert_list) + else: + raise MissingTrustedRoots(None) return True diff --git a/sfa/util/faults.py b/sfa/util/faults.py index dbc439f2..b8dee9e3 100644 --- a/sfa/util/faults.py +++ b/sfa/util/faults.py @@ -238,3 +238,11 @@ class BadRequestHash(xmlrpclib.Fault): def __init__(self, hash = None): faultString = "bad request hash: " + str(hash) xmlrpclib.Fault.__init__(self, 902, faultString) + +class MissingTrustedRoots(GeniFault): + def __init__(self, value, extra = None): + self.value = value + faultString = "Trusted root directory does not exist: %(value)s" % locals() + GeniFault.__init__(self, 102, faultString, extra) + def __str__(self): + return repr(self.value)