From ce469b65294321b9cef0c1734d946b5a1a537f07 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 5 Dec 2007 05:17:55 +0000 Subject: Checkpoint svn path=/scripts/apnic-poke-1.sh; revision=1364 --- scripts/rpkid.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/rpkid.py') diff --git a/scripts/rpkid.py b/scripts/rpkid.py index feed9add..d12fc5bf 100755 --- a/scripts/rpkid.py +++ b/scripts/rpkid.py @@ -8,7 +8,7 @@ Usage: python rpkid.py [ { -c | --config } configfile ] [ { -h | --help } ] Default configuration file is rpkid.conf, override with --config option. """ -import traceback, os, time, getopt, sys, MySQLdb +import traceback, os, time, getopt, sys, MySQLdb, lxml.etree import rpki.resource_set, rpki.up_down, rpki.left_right, rpki.x509 import rpki.https, rpki.config, rpki.cms, rpki.exceptions, rpki.relaxng @@ -23,6 +23,11 @@ def left_right_handler(query, path): rpki.relaxng.left_right.assertValid(r_elt) reply = rpki.cms.xml_sign(r_elt, gctx.cms_key, gctx.cms_certs) return 200, reply + except lxml.etree.DocumentInvalid: + print "Received reply document does not pass schema check:" + print lxml.etree.tostring(r_elt, pretty_print = True) + traceback.print_exc() + return 500, "Schema violation" except Exception, data: traceback.print_exc() return 500, "Unhandled exception %s" % data -- cgit v1.2.3