Make __all__ immutable

Using a mutable type implies that it's acceptable for the set of
publicly-accessible attributes to be mutated at runtime, which defeats
their intended purpose of documenting the public interface. Tuples are
immutable.

Change-Id: Ib3ab93224ba240040b08ece481ef5ba620c3f658
This commit is contained in:
Dolph Mathews
2015-10-01 16:56:33 +00:00
parent eb1dbe8e5a
commit eb77abd77a
16 changed files with 27 additions and 28 deletions

View File

@@ -34,7 +34,7 @@ import pbr.version
__version__ = pbr.version.VersionInfo('python-keystoneclient').version_string() __version__ = pbr.version.VersionInfo('python-keystoneclient').version_string()
__all__ = [ __all__ = (
# Modules # Modules
'generic', 'generic',
'v2_0', 'v2_0',
@@ -46,7 +46,7 @@ __all__ = [
'exceptions', 'exceptions',
'httpclient', 'httpclient',
'service_catalog', 'service_catalog',
] )
class _LazyImporter(object): class _LazyImporter(object):

View File

@@ -36,6 +36,6 @@ removals.removed_module('keystoneclient.apiclient',
version='0.7.1', version='0.7.1',
removal_version='2.0') removal_version='2.0')
__all__ = [ __all__ = (
'exceptions', 'exceptions',
] )

View File

@@ -16,7 +16,7 @@ from keystoneclient.auth.cli import * # noqa
from keystoneclient.auth.conf import * # noqa from keystoneclient.auth.conf import * # noqa
__all__ = [ __all__ = (
# auth.base # auth.base
'AUTH_INTERFACE', 'AUTH_INTERFACE',
'BaseAuthPlugin', 'BaseAuthPlugin',
@@ -35,4 +35,4 @@ __all__ = [
'get_plugin_options', 'get_plugin_options',
'load_from_conf_options', 'load_from_conf_options',
'register_conf_options', 'register_conf_options',
] )

View File

@@ -28,10 +28,10 @@ Password = generic.Password
Token = generic.Token Token = generic.Token
__all__ = ['BaseIdentityPlugin', __all__ = ('BaseIdentityPlugin',
'Password', 'Password',
'Token', 'Token',
'V2Password', 'V2Password',
'V2Token', 'V2Token',
'V3Password', 'V3Password',
'V3Token'] 'V3Token')

View File

@@ -15,7 +15,7 @@ from keystoneclient.auth.identity.generic.password import Password # noqa
from keystoneclient.auth.identity.generic.token import Token # noqa from keystoneclient.auth.identity.generic.token import Token # noqa
__all__ = ['BaseGenericPlugin', __all__ = ('BaseGenericPlugin',
'Password', 'Password',
'Token', 'Token',
] )

View File

@@ -16,7 +16,7 @@ from keystoneclient.auth.identity.v3.password import * # noqa
from keystoneclient.auth.identity.v3.token import * # noqa from keystoneclient.auth.identity.v3.token import * # noqa
__all__ = ['Auth', __all__ = ('Auth',
'AuthConstructor', 'AuthConstructor',
'AuthMethod', 'AuthMethod',
'BaseAuth', 'BaseAuth',
@@ -27,4 +27,4 @@ __all__ = ['Auth',
'PasswordMethod', 'PasswordMethod',
'Token', 'Token',
'TokenMethod'] 'TokenMethod')

View File

@@ -24,7 +24,7 @@ from keystoneclient import utils
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
__all__ = ['Auth', 'AuthMethod', 'AuthConstructor', 'BaseAuth'] __all__ = ('Auth', 'AuthMethod', 'AuthConstructor', 'BaseAuth')
@six.add_metaclass(abc.ABCMeta) @six.add_metaclass(abc.ABCMeta)

View File

@@ -18,7 +18,7 @@ import six
from keystoneclient.auth.identity.v3 import base from keystoneclient.auth.identity.v3 import base
from keystoneclient.auth.identity.v3 import token from keystoneclient.auth.identity.v3 import token
__all__ = ['FederatedBaseAuth'] __all__ = ('FederatedBaseAuth',)
@six.add_metaclass(abc.ABCMeta) @six.add_metaclass(abc.ABCMeta)

View File

@@ -16,7 +16,7 @@ from keystoneclient.auth.identity.v3 import base
from keystoneclient import utils from keystoneclient import utils
__all__ = ['PasswordMethod', 'Password'] __all__ = ('PasswordMethod', 'Password')
class PasswordMethod(base.AuthMethod): class PasswordMethod(base.AuthMethod):

View File

@@ -15,7 +15,7 @@ from oslo_config import cfg
from keystoneclient.auth.identity.v3 import base from keystoneclient.auth.identity.v3 import base
__all__ = ['TokenMethod', 'Token'] __all__ = ('TokenMethod', 'Token')
class TokenMethod(base.AuthMethod): class TokenMethod(base.AuthMethod):

View File

@@ -32,11 +32,11 @@ V2Token = v2.Token
V3Token = v3.Token V3Token = v3.Token
V3FederationToken = v3.V3FederationToken V3FederationToken = v3.V3FederationToken
__all__ = ['DiscoveryList', __all__ = ('DiscoveryList',
'FixtureValidationError', 'FixtureValidationError',
'V2Discovery', 'V2Discovery',
'V3Discovery', 'V3Discovery',
'V2Token', 'V2Token',
'V3Token', 'V3Token',
'V3FederationToken', 'V3FederationToken',
] )

View File

@@ -16,10 +16,10 @@ from oslo_utils import timeutils
from keystoneclient import utils from keystoneclient import utils
__all__ = ['DiscoveryList', __all__ = ('DiscoveryList',
'V2Discovery', 'V2Discovery',
'V3Discovery', 'V3Discovery',
] )
_DEFAULT_DAYS_AGO = 30 _DEFAULT_DAYS_AGO = 30

View File

@@ -1,4 +1,4 @@
__all__ = [ __all__ = (
'client', 'client',
] )

View File

@@ -1,6 +1,6 @@
from keystoneclient.v2_0.client import Client # noqa from keystoneclient.v2_0.client import Client # noqa
__all__ = [ __all__ = (
'client', 'client',
] )

View File

@@ -2,6 +2,6 @@
from keystoneclient.v3.client import Client # noqa from keystoneclient.v3.client import Client # noqa
__all__ = [ __all__ = (
'client', 'client',
] )

View File

@@ -1,3 +1,2 @@
__all__ = [ __all__ = tuple()
]