Merge "Fix and enable gating on H403"
This commit is contained in:
@@ -19,7 +19,8 @@ class AuthorizationFailure(Exception):
|
||||
|
||||
class NoTokenLookupException(Exception):
|
||||
"""This form of authentication does not support looking up
|
||||
endpoints from an existing token."""
|
||||
endpoints from an existing token.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
|
@@ -57,7 +57,8 @@ class Client(object):
|
||||
def get(self, key):
|
||||
"""Retrieves the value for a key or None.
|
||||
|
||||
this expunges expired keys during each get"""
|
||||
this expunges expired keys during each get
|
||||
"""
|
||||
|
||||
now = timeutils.utcnow_ts()
|
||||
for k in self.cache.keys():
|
||||
|
@@ -141,7 +141,8 @@ def clear_time_override():
|
||||
def marshall_now(now=None):
|
||||
"""Make an rpc-safe datetime with microseconds.
|
||||
|
||||
Note: tzinfo is stripped, but not required for relative times."""
|
||||
Note: tzinfo is stripped, but not required for relative times.
|
||||
"""
|
||||
if not now:
|
||||
now = utcnow()
|
||||
return dict(day=now.day, month=now.month, year=now.year, hour=now.hour,
|
||||
|
@@ -93,7 +93,8 @@ class ServiceCatalog(object):
|
||||
|
||||
class ServiceCatalogV2(ServiceCatalog):
|
||||
"""An object for encapsulating the service catalog using raw v2 auth token
|
||||
from Keystone."""
|
||||
from Keystone.
|
||||
"""
|
||||
|
||||
def __init__(self, resource_dict, region_name=None):
|
||||
self.catalog = resource_dict
|
||||
@@ -179,7 +180,8 @@ class ServiceCatalogV2(ServiceCatalog):
|
||||
|
||||
class ServiceCatalogV3(ServiceCatalog):
|
||||
"""An object for encapsulating the service catalog using raw v3 auth token
|
||||
from Keystone."""
|
||||
from Keystone.
|
||||
"""
|
||||
|
||||
def __init__(self, token, resource_dict, region_name=None):
|
||||
self._auth_token = token
|
||||
|
@@ -197,7 +197,8 @@ class Client(client.HTTPClient):
|
||||
"""Takes a username, password, and optionally a tenant_id or
|
||||
tenant_name to get an authentication token from keystone.
|
||||
May also take a token and a tenant_id to re-scope a token
|
||||
to a tenant."""
|
||||
to a tenant.
|
||||
"""
|
||||
headers = {}
|
||||
url = auth_url + "/tokens"
|
||||
if token:
|
||||
|
@@ -699,7 +699,8 @@ if tuple(sys.version_info)[0:2] < (2, 7):
|
||||
class AdjustedBaseAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
|
||||
def assertIsInstance(self, obj, cls, msg=None):
|
||||
"""Same as self.assertTrue(isinstance(obj, cls)), with a nicer
|
||||
default message."""
|
||||
default message.
|
||||
"""
|
||||
if not isinstance(obj, cls):
|
||||
standardMsg = '%s is not an instance of %r' % (obj, cls)
|
||||
self.fail(self._formatMessage(msg, standardMsg))
|
||||
|
@@ -293,7 +293,8 @@ class ShellTest(utils.TestCase):
|
||||
|
||||
def test_shell_tenant_id_args(self):
|
||||
"""Test a corner case where --tenant_id appears on the
|
||||
command-line twice"""
|
||||
command-line twice.
|
||||
"""
|
||||
do_ec2_mock = mock.MagicMock()
|
||||
# grab the decorators for do_ec2_create_credentials
|
||||
ec2_func = getattr(shell_v2_0, 'do_ec2_credentials_create')
|
||||
|
3
tox.ini
3
tox.ini
@@ -35,9 +35,8 @@ downloadcache = ~/cache/pip
|
||||
# H302: import only modules
|
||||
# H304: no relative imports
|
||||
# H306: imports not in alphabetical order
|
||||
# H403: multi line docstring end on new line
|
||||
# H404: multi line docstring should start with a summary
|
||||
# H802: git commit title
|
||||
ignore = F811,F821,F841,H201,H202,H302,H304,H306,H403,H404,H802
|
||||
ignore = F811,F821,F841,H201,H202,H302,H304,H306,H404,H802
|
||||
show-source = True
|
||||
exclude = .venv,.tox,dist,doc,*egg,build
|
||||
|
Reference in New Issue
Block a user