Skip to content

Commit

Permalink
no logging on cms failure
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Adam Young committed Jul 27, 2013
1 parent fd8f053 commit 2bb6137
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions keystoneclient/common/cms.py
Expand Up @@ -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,
Expand All @@ -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")
Expand Down
1 change: 1 addition & 0 deletions keystoneclient/middleware/auth_token.py
Expand Up @@ -1047,6 +1047,7 @@ def cms_verify(self, data):
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

Expand Down

0 comments on commit 2bb6137

Please sign in to comment.