From 4bfce3609692f1426af1b797b18dc7b292b6bdd1 Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Wed, 19 Dec 2012 12:51:20 -0600 Subject: Trap exception when trying to write csr Trap the exception when trying to write the csr fails. Fixes LP: #1092016 Change-Id: I05675c8c7b1d205a06d13dd3e62e06088d1b896d Signed-off-by: Chuck Short --- nova/crypto.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'nova/crypto.py') diff --git a/nova/crypto.py b/nova/crypto.py index 73af2f25a4..41e8e9869c 100644 --- a/nova/crypto.py +++ b/nova/crypto.py @@ -295,8 +295,12 @@ def _sign_csr(csr_text, ca_folder): inbound = os.path.join(tmpdir, 'inbound.csr') outbound = os.path.join(tmpdir, 'outbound.csr') - with open(inbound, 'w') as csrfile: - csrfile.write(csr_text) + try: + with open(inbound, 'w') as csrfile: + csrfile.write(csr_text) + except IOError: + LOG.exception(_('Failed to write inbound.csr')) + raise LOG.debug(_('Flags path: %s'), ca_folder) start = os.getcwd() -- cgit v1.2.1