summaryrefslogtreecommitdiff
path: root/nova/crypto.py
diff options
context:
space:
mode:
authorChuck Short <chuck.short@canonical.com>2012-12-19 12:51:20 -0600
committerChuck Short <chuck.short@canonical.com>2012-12-19 12:52:51 -0600
commit4bfce3609692f1426af1b797b18dc7b292b6bdd1 (patch)
tree905995c7af26f81b4e859d2ea4273454e54bf452 /nova/crypto.py
parentcbf9d897384b22b45f253fa78c1dd08d13f6a2e8 (diff)
downloadnova-4bfce3609692f1426af1b797b18dc7b292b6bdd1.tar.gz
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 <chuck.short@canonical.com>
Diffstat (limited to 'nova/crypto.py')
-rw-r--r--nova/crypto.py8
1 files changed, 6 insertions, 2 deletions
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()