Merge " Cleanup docstrings " from keystone/common/cms.py

In an attempt to unify both implementations in order to
be able to remove one of the duplicated ones, merge the
changes from this commit in keystone:

    Author: Dolph Mathews <dolph.mathews@gmail.com>
    Date:   Fri May 24 11:36:44 2013 -0500

    Cleanup docstrings (flake8 H401, H402, H403, H404)

Change-Id: Ib23c9ab5066cfdcdda4e07cd30fa8f6ff47949bd
This commit is contained in:
Dirk Mueller
2013-07-09 18:28:34 +02:00
parent 6d0afcc98e
commit c555662b20

View File

@@ -25,9 +25,7 @@ def _ensure_subprocess():
def cms_verify(formatted, signing_cert_file_name, ca_file_name): 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
"""
_ensure_subprocess() _ensure_subprocess()
process = subprocess.Popen(["openssl", "cms", "-verify", process = subprocess.Popen(["openssl", "cms", "-verify",
"-certfile", signing_cert_file_name, "-certfile", signing_cert_file_name,
@@ -76,7 +74,8 @@ def verify_token(token, signing_cert_file_name, ca_file_name):
def is_ans1_token(token): def is_ans1_token(token):
''' """Determine if a token appears to be PKI-based.
thx to ayoung for sorting this out. thx to ayoung for sorting this out.
base64 decoded hex representation of MII is 3082 base64 decoded hex representation of MII is 3082
@@ -113,7 +112,7 @@ def is_ans1_token(token):
Max length of the content using 2 octets is 7FFF or 32767 Max length of the content using 2 octets is 7FFF or 32767
It's not practical to support a token of this length or greater in http It's not practical to support a token of this length or greater in http
therefore, we will check for MII only and ignore the case of larger tokens therefore, we will check for MII only and ignore the case of larger tokens
''' """
return token[:3] == PKI_ANS1_PREFIX return token[:3] == PKI_ANS1_PREFIX
@@ -160,7 +159,8 @@ def cms_to_token(cms_text):
def cms_hash_token(token_id): def cms_hash_token(token_id):
""" """Hash PKI tokens.
return: for ans1_token, returns the hash of the passed in token return: for ans1_token, returns the hash of the passed in token
otherwise, returns what it was passed in. otherwise, returns what it was passed in.
""" """