Merge "Use str() to generate IOError exception message"

This commit is contained in:
Jenkins 2016-03-02 07:05:20 +00:00 committed by Gerrit Code Review
commit 808d1f1d31
1 changed files with 4 additions and 4 deletions

View File

@ -113,7 +113,7 @@ class CertManager(cert_manager.CertManager):
pass_file.write(private_key_passphrase)
except IOError as ioe:
LOG.error(_LE("Failed to store certificate."))
raise exception.CertificateStorageException(msg=ioe.message)
raise exception.CertificateStorageException(msg=str(ioe))
return cert_ref
@ -168,7 +168,7 @@ class CertManager(cert_manager.CertManager):
cert_data['intermediates'] = int_file.read()
except IOError as ioe:
LOG.error(_LE("Failed to read certificate."))
raise exception.CertificateStorageException(msg=ioe.message)
raise exception.CertificateStorageException(msg=str(ioe))
try:
if path.isfile(filename_pkp):
@ -176,7 +176,7 @@ class CertManager(cert_manager.CertManager):
cert_data['private_key_passphrase'] = pass_file.read()
except IOError as ioe:
LOG.error(_LE("Failed to read certificate."))
raise exception.CertificateStorageException(msg=ioe.message)
raise exception.CertificateStorageException(msg=str(ioe))
return Cert(**cert_data)
@ -211,4 +211,4 @@ class CertManager(cert_manager.CertManager):
LOG.error(_LE(
"Failed to delete certificate {0}."
).format(cert_ref))
raise exception.CertificateStorageException(msg=ioe.message)
raise exception.CertificateStorageException(msg=str(ioe))