aboutsummaryrefslogtreecommitdiff
path: root/rpkid/cronjob.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2008-05-15 17:46:33 +0000
committerRob Austein <sra@hactrn.net>2008-05-15 17:46:33 +0000
commit6d7cbc192185d6ea20ab383ef329fd71f19907b9 (patch)
tree448ccbf4ede933add725326d1734c18868f04bad /rpkid/cronjob.py
parent9256db5c909e00835836ffc06f43869523cbcde3 (diff)
Clean up TLS certificate handling and a lot of debugging code.
svn path=/rpkid/cronjob.py; revision=1778
Diffstat (limited to 'rpkid/cronjob.py')
-rw-r--r--rpkid/cronjob.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/rpkid/cronjob.py b/rpkid/cronjob.py
index f2c1748d..b67f698c 100644
--- a/rpkid/cronjob.py
+++ b/rpkid/cronjob.py
@@ -18,7 +18,8 @@
Tool to trigger "cron" runs in rpkid.
Usage: python cronjob.py [ { -c | --config } configfile ]
- [ { -h | --help } ]
+ [ { -d | --debug } ]
+ [ { -h | --help } ]
Default configuration file is cronjob.conf, override with --config option.
"""
@@ -26,6 +27,7 @@ Default configuration file is cronjob.conf, override with --config option.
import rpki.config, rpki.https, getopt, sys
cfg_file = "cronjob.conf"
+debug = False
opts,argv = getopt.getopt(sys.argv[1:], "c:h?", ["config=", "help"])
for o,a in opts:
@@ -34,15 +36,17 @@ for o,a in opts:
sys.exit(0)
elif o in ("-c", "--config"):
cfg_file = a
+ elif o in ("-d", "--debug"):
+ debug = True
if argv:
print __doc__
raise RuntimeError, "Unexpected arguments %s" % argv
cfg = rpki.config.parser(cfg_file, "cronjob")
-# Some day this should be conditional
-rpki.log.init("cronjob")
-rpki.log.set_trace(True)
+if debug:
+ rpki.log.init("cronjob")
+ rpki.log.set_trace(True)
irbe_key = rpki.x509.RSA( Auto_file = cfg.get("irbe-key"))
irbe_cert = rpki.x509.X509(Auto_file = cfg.get("irbe-cert"))