aboutsummaryrefslogtreecommitdiff
path: root/rcynic/validation_status.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-05-19 22:52:41 +0000
committerRob Austein <sra@hactrn.net>2012-05-19 22:52:41 +0000
commit8caeed05bb339cd866588acb1c3572761a65e691 (patch)
tree0ee64369d6a10c7b7021ca9b5ac0ea63f0ef6ed4 /rcynic/validation_status.py
parentfa43dc24ff67ba61c638992996ce6f72c42197d7 (diff)
We already use Python pretty heavily in the relying party tools, so
start phasing out the silly XSL + AWK hacks. svn path=/trunk/; revision=4501
Diffstat (limited to 'rcynic/validation_status.py')
-rw-r--r--rcynic/validation_status.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/rcynic/validation_status.py b/rcynic/validation_status.py
new file mode 100644
index 00000000..2564d531
--- /dev/null
+++ b/rcynic/validation_status.py
@@ -0,0 +1,34 @@
+"""
+Flat text listing of <validation_status/> elements from rcynic.xml.
+
+$Id$
+
+Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+"""
+
+import sys
+
+try:
+ from lxml.etree import ElementTree
+except ImportError:
+ from xml.etree.ElementTree import ElementTree
+
+for filename in sys.argv[1:]:
+ for elt in ElementTree(file = filename).findall("validation_status"):
+ print "%s %8s %-40s %s" % (
+ elt.get("timestamp"),
+ elt.get("generation"),
+ elt.get("status"),
+ elt.text.strip())