aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rpkid/rpki/https.py4
-rw-r--r--rpkid/rpki/left_right.py23
-rw-r--r--rpkid/rpki/publication.py4
-rw-r--r--rpkid/rpki/up_down.py4
-rw-r--r--rpkid/testpoke.py8
5 files changed, 22 insertions, 21 deletions
diff --git a/rpkid/rpki/https.py b/rpkid/rpki/https.py
index ccb74488..b7651d53 100644
--- a/rpkid/rpki/https.py
+++ b/rpkid/rpki/https.py
@@ -440,9 +440,9 @@ class http_server(http_stream):
handler(self.msg.body, self.msg.path, self.send_reply)
except (rpki.async.ExitNow, SystemExit):
raise
- except Exception, edata:
+ except Exception, e:
rpki.log.traceback()
- self.send_error(500, "Unhandled exception %s" % edata)
+ self.send_error(500, "Unhandled exception %s" % e)
else:
self.send_error(code = error[0], reason = error[1])
diff --git a/rpkid/rpki/left_right.py b/rpkid/rpki/left_right.py
index 7a9ef4f2..a6489179 100644
--- a/rpkid/rpki/left_right.py
+++ b/rpkid/rpki/left_right.py
@@ -580,19 +580,20 @@ class repository_elt(data_elt):
def done(r_cms):
try:
r_msg = rpki.publication.cms_msg.unwrap(r_cms, bpki_ta_path)
- if len(r_msg) != 1: # Some day we may allow this, but not today
+ for r_pdu in r_msg:
+ if isinstance(r_pdu, rpki.publication.report_error_elt):
+ t = rpki.exceptions.__dict__.get(r_pdu.error_code)
+ if isinstance(t, type) and issubclass(t, rpki.exceptions.RPKI_Exception):
+ raise t, getattr(r_pdu, "text", None)
+ else:
+ raise rpki.exceptions.BadPublicationReply, "Unexpected response from pubd: %s" % r_pdu
+ if len(pdus) != len(r_msg):
raise rpki.exceptions.BadPublicationReply, "Unexpected response from pubd: %r" % r_msg
- if isinstance(r_msg[0], rpki.publication.report_error_elt):
- t = rpki.exceptions.__dict__.get(r_msg[0].error_code)
- if isinstance(t, type) and issubclass(t, rpki.exceptions.RPKI_Exception):
- raise t, getattr(r_msg[0], "text", None)
- else:
- raise rpki.exceptions.BadPublicationReply, "Unexpected response from pubd: %s" % r_msg[0]
callback()
except (rpki.async.ExitNow, SystemExit):
raise
- except Exception, edata:
- errback(edata)
+ except Exception, e:
+ errback(e)
rpki.https.client(
client_key = bsc.private_key_id,
@@ -950,8 +951,8 @@ class msg(rpki.xml_utils.msg, left_right_namespace):
q_pdu.serve_dispatch(r_msg, iterator, fail)
except (rpki.async.ExitNow, SystemExit):
raise
- except Exception, edata:
- fail(edata)
+ except Exception, e:
+ fail(e)
def done():
cb(r_msg)
diff --git a/rpkid/rpki/publication.py b/rpkid/rpki/publication.py
index 4f50be26..afeedf62 100644
--- a/rpkid/rpki/publication.py
+++ b/rpkid/rpki/publication.py
@@ -353,8 +353,8 @@ class msg(rpki.xml_utils.msg, publication_namespace):
q_pdu.serve_dispatch(r_msg, iterator, fail)
except (rpki.async.ExitNow, SystemExit):
raise
- except Exception, edata:
- fail(edata)
+ except Exception, e:
+ fail(e)
def done():
cb(r_msg)
diff --git a/rpkid/rpki/up_down.py b/rpkid/rpki/up_down.py
index 22168d11..8406d030 100644
--- a/rpkid/rpki/up_down.py
+++ b/rpkid/rpki/up_down.py
@@ -635,8 +635,8 @@ class message_pdu(base_elt):
self.payload.serve_pdu(self, r_msg, child, done, lose)
except (rpki.async.ExitNow, SystemExit):
raise
- except Exception, edata:
- lose(edata)
+ except Exception, e:
+ lose(e)
def log_query(self, child):
"""
diff --git a/rpkid/testpoke.py b/rpkid/testpoke.py
index 4ea4a7fb..949cd464 100644
--- a/rpkid/testpoke.py
+++ b/rpkid/testpoke.py
@@ -104,8 +104,8 @@ def query_up_down(q_pdu):
r_msg.payload.check_response()
except (rpki.async.ExitNow, SystemExit):
raise
- except Exception, edata:
- fail(edata)
+ except Exception, e:
+ fail(e)
#rpki.async.exit_event_loop()
rpki.https.want_persistent_client = False
@@ -159,5 +159,5 @@ https_ca_certs = get_PEM_chain("ssl-ca-certs")
try:
dispatch[yaml_req["type"]]()
rpki.async.event_loop()
-except Exception, edata:
- fail(edata)
+except Exception, e:
+ fail(e)