diff options
Diffstat (limited to 'rpki/publication_control.py')
-rw-r--r-- | rpki/publication_control.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/rpki/publication_control.py b/rpki/publication_control.py index ddb9d417..b0668eef 100644 --- a/rpki/publication_control.py +++ b/rpki/publication_control.py @@ -44,31 +44,31 @@ tag_report_error = rpki.relaxng.publication_control.xmlns + "report_error" def raise_if_error(pdu): - """ - Raise an appropriate error if this is a <report_error/> PDU. + """ + Raise an appropriate error if this is a <report_error/> PDU. - As a convience, this will also accept a <msg/> PDU and raise an - appropriate error if it contains any <report_error/> PDUs. - """ + As a convience, this will also accept a <msg/> PDU and raise an + appropriate error if it contains any <report_error/> PDUs. + """ - if pdu.tag == tag_report_error: - code = pdu.get("error_code") - logger.debug("<report_error/> code %r", code) - e = getattr(rpki.exceptions, code, None) - if e is not None and issubclass(e, rpki.exceptions.RPKI_Exception): - raise e(pdu.text) - else: - raise rpki.exceptions.BadPublicationReply("Unexpected response from pubd: %r, %r" % (code, pdu)) + if pdu.tag == tag_report_error: + code = pdu.get("error_code") + logger.debug("<report_error/> code %r", code) + e = getattr(rpki.exceptions, code, None) + if e is not None and issubclass(e, rpki.exceptions.RPKI_Exception): + raise e(pdu.text) + else: + raise rpki.exceptions.BadPublicationReply("Unexpected response from pubd: %r, %r" % (code, pdu)) - if pdu.tag == tag_msg: - for p in pdu: - raise_if_error(p) + if pdu.tag == tag_msg: + for p in pdu: + raise_if_error(p) class cms_msg(rpki.x509.XML_CMS_object): - """ - CMS-signed publication control PDU. - """ + """ + CMS-signed publication control PDU. + """ - encoding = "us-ascii" - schema = rpki.relaxng.publication_control + encoding = "us-ascii" + schema = rpki.relaxng.publication_control |