diff options
author | Rob Austein <sra@hactrn.net> | 2009-09-04 21:30:08 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-09-04 21:30:08 +0000 |
commit | 737e007f2d557b4fa48a4236214dce03be740998 (patch) | |
tree | ceb7b1b812807c667d17728567211f9c44ba6b3d /myrpki/myirbe.py | |
parent | 57c3a43ebac6a135e3a0f2abaa860ca68eedf963 (diff) |
Don't explode if publication client cert doesn't exist.
svn path=/myrpki/myirbe.py; revision=2733
Diffstat (limited to 'myrpki/myirbe.py')
-rw-r--r-- | myrpki/myirbe.py | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/myrpki/myirbe.py b/myrpki/myirbe.py index 683e9c1b..a955a944 100644 --- a/myrpki/myirbe.py +++ b/myrpki/myirbe.py @@ -461,18 +461,23 @@ for xmlfile in xmlfiles: for client_handle, client_bpki_cert, client_base_uri in myrpki.csv_open(cfg.get("pubclients_csv", "pubclients.csv")): - client_pdu = client_pdus.pop(client_handle, None) - - client_bpki_cert = rpki.x509.X509(PEM_file = bpki.xcert(client_bpki_cert)) - - if (client_pdu is None or - client_pdu.base_uri != client_base_uri or - client_pdu.bpki_cert != client_bpki_cert): - pubd_query.append(rpki.publication.client_elt.make_pdu( - action = "create" if client_pdu is None else "set", - client_handle = client_handle, - bpki_cert = client_bpki_cert, - base_uri = client_base_uri)) + if os.path.exists(client_bpki_cert): + + client_pdu = client_pdus.pop(client_handle, None) + + client_bpki_cert = rpki.x509.X509(PEM_file = bpki.xcert(client_bpki_cert)) + + if (client_pdu is None or + client_pdu.base_uri != client_base_uri or + client_pdu.bpki_cert != client_bpki_cert): + pubd_query.append(rpki.publication.client_elt.make_pdu( + action = "create" if client_pdu is None else "set", + client_handle = client_handle, + bpki_cert = client_bpki_cert, + base_uri = client_base_uri)) + + pubd_query.extend(rpki.publication.client_elt.make_pdu( + action = "destroy", client_handle = p) for p in client_pdus) # If we changed anything, ship updates off to daemons |