aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2010-07-11 12:25:21 +0000
committerRob Austein <sra@hactrn.net>2010-07-11 12:25:21 +0000
commit937f0ae8085d78c2ee6816ef107e11ca5517c2e2 (patch)
treee7506cfdcdaa3b84fdfa39295c75c76024b2e15a
parenta0a725ccaf14eef16cbe92da06f3ef27ccea1f29 (diff)
Clean up uses of RuntimeError exception
svn path=/rpkid/irdbd.py; revision=3378
-rw-r--r--rpkid/irdbd.py2
-rw-r--r--rpkid/pubd.py2
-rw-r--r--rpkid/rootd.py2
-rw-r--r--rpkid/rpki/exceptions.py5
-rw-r--r--rpkid/rpkid.py2
-rw-r--r--rpkid/tests/smoketest.py2
-rw-r--r--rpkid/tests/yamltest.py4
7 files changed, 12 insertions, 7 deletions
diff --git a/rpkid/irdbd.py b/rpkid/irdbd.py
index ac32a907..98b90153 100644
--- a/rpkid/irdbd.py
+++ b/rpkid/irdbd.py
@@ -179,7 +179,7 @@ for o, a in opts:
elif o in ("-d", "--debug"):
rpki.log.use_syslog = False
if argv:
- raise RuntimeError, "Unexpected arguments %s" % argv
+ raise rpki.exceptions.CommandParseFailure, "Unexpected arguments %s" % argv
rpki.log.init("irdbd")
diff --git a/rpkid/pubd.py b/rpkid/pubd.py
index 8288116f..ca097923 100644
--- a/rpkid/pubd.py
+++ b/rpkid/pubd.py
@@ -167,7 +167,7 @@ for o, a in opts:
elif o in ("-p", "--profile"):
profile = a
if argv:
- raise RuntimeError, "Unexpected arguments %s" % argv
+ raise rpki.exceptions.CommandParseFailure, "Unexpected arguments %s" % argv
rpki.log.init("pubd")
diff --git a/rpkid/rootd.py b/rpkid/rootd.py
index a87c0168..7643aafd 100644
--- a/rpkid/rootd.py
+++ b/rpkid/rootd.py
@@ -277,7 +277,7 @@ for o, a in opts:
elif o in ("-d", "--debug"):
rpki.log.use_syslog = False
if argv:
- raise RuntimeError, "Unexpected arguments %s" % argv
+ raise rpki.exceptions.CommandParseFailure, "Unexpected arguments %s" % argv
rpki.log.init("rootd")
diff --git a/rpkid/rpki/exceptions.py b/rpkid/rpki/exceptions.py
index f4b823be..8e77beab 100644
--- a/rpkid/rpki/exceptions.py
+++ b/rpkid/rpki/exceptions.py
@@ -321,3 +321,8 @@ class BadROAPrefix(RPKI_Exception):
"""
Parse failure for alleged ROA prefix string.
"""
+
+class CommandParseFailure(RPKI_Exception):
+ """
+ Failed to parse command line.
+ """
diff --git a/rpkid/rpkid.py b/rpkid/rpkid.py
index 05e40e39..da3c9f22 100644
--- a/rpkid/rpkid.py
+++ b/rpkid/rpkid.py
@@ -61,7 +61,7 @@ for o, a in opts:
elif o in ("-p", "--profile"):
profile = a
if argv:
- raise RuntimeError, "Unexpected arguments %s" % argv
+ raise rpki.exceptions.CommandParseFailure, "Unexpected arguments %s" % argv
rpki.log.init("rpkid")
diff --git a/rpkid/tests/smoketest.py b/rpkid/tests/smoketest.py
index 1d7dc266..44897929 100644
--- a/rpkid/tests/smoketest.py
+++ b/rpkid/tests/smoketest.py
@@ -83,7 +83,7 @@ for o, a in opts:
yaml_script = a
if argv:
print __doc__
- raise RuntimeError, "Unexpected arguments %s" % argv
+ raise rpki.exceptions.CommandParseFailure, "Unexpected arguments %s" % argv
cfg = rpki.config.parser(cfg_file, "smoketest", allow_missing = True)
diff --git a/rpkid/tests/yamltest.py b/rpkid/tests/yamltest.py
index 5f05d65f..8b8e87d6 100644
--- a/rpkid/tests/yamltest.py
+++ b/rpkid/tests/yamltest.py
@@ -543,11 +543,11 @@ for o, a in opts:
elif o in ("-p", "--pidfile"):
pidfile = a
-# We can't usefully process more than one YAMl file at a time, so
+# We can't usefully process more than one YAML file at a time, so
# whine if there's more than one argument left.
if len(argv) > 1:
- raise RuntimeError, "Unexpected arguments %r" % argv
+ raise rpki.exceptions.CommandParseFailure, "Unexpected arguments %r" % argv
try: