From 2bb6137f48b7516a6870dd86700d09d8aa977caf Mon Sep 17 00:00:00 2001 From: Adam Young Date: Mon, 22 Jul 2013 13:50:46 -0400 Subject: [PATCH] no logging on cms failure Don't log in the keystoneclient.common.cms as there are some errors that are expected. Instead, log in the middleware bug 1189539 Change-Id: I1e80e2ab35e073d9b8d25fd16b31c64c34cd001d --- keystoneclient/common/cms.py | 8 ++++++-- keystoneclient/middleware/auth_token.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/keystoneclient/common/cms.py b/keystoneclient/common/cms.py index 26f9795ae..e07dbcf88 100644 --- a/keystoneclient/common/cms.py +++ b/keystoneclient/common/cms.py @@ -25,7 +25,10 @@ def _ensure_subprocess(): def cms_verify(formatted, signing_cert_file_name, ca_file_name): - """Verifies the signature of the contents IAW CMS syntax.""" + """Verifies the signature of the contents IAW CMS syntax. + + :raises: subprocess.CalledProcessError + """ _ensure_subprocess() process = subprocess.Popen(["openssl", "cms", "-verify", "-certfile", signing_cert_file_name, @@ -39,7 +42,8 @@ def cms_verify(formatted, signing_cert_file_name, ca_file_name): output, err = process.communicate(formatted) retcode = process.poll() if retcode: - LOG.warning('Verify error: %s' % err) + # Do not log errors, as some happen in the positive thread + # instead, catch them in the calling code and log them there. # NOTE(dmllr): Python 2.6 compatibility: # CalledProcessError did not have output keyword argument e = subprocess.CalledProcessError(retcode, "openssl") diff --git a/keystoneclient/middleware/auth_token.py b/keystoneclient/middleware/auth_token.py index 6537a6778..658cce542 100644 --- a/keystoneclient/middleware/auth_token.py +++ b/keystoneclient/middleware/auth_token.py @@ -1047,6 +1047,7 @@ class AuthProtocol(object): if self.cert_file_missing(err.output, self.ca_file_name): self.fetch_ca_cert() continue + self.LOG.warning('Verify error: %s' % err) raise err return output