From 151ecb656399f0b67e10ced88e2c3867e764857a Mon Sep 17 00:00:00 2001 From: Anil-Kumar Vengalil Date: Mon, 30 Nov 2009 15:57:12 +0000 Subject: [PATCH] ensruing that trusted_root directory is present and holds root gids --- sfa/trust/auth.py | 2 ++ sfa/util/faults.py | 8 ++++++++ 2 files changed, 10 insertions(+) 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) -- 2.43.0