From 10c5961426aa358a045d56f66daf0642a584334c Mon Sep 17 00:00:00 2001 From: Dolph Mathews Date: Thu, 1 Oct 2015 17:27:11 +0000 Subject: [PATCH] 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 --- keystoneauth1/access/__init__.py | 4 ++-- keystoneauth1/access/access.py | 4 ++-- keystoneauth1/exceptions/auth_plugins.py | 4 ++-- keystoneauth1/exceptions/base.py | 2 +- keystoneauth1/exceptions/catalog.py | 4 ++-- keystoneauth1/exceptions/connection.py | 4 ++-- keystoneauth1/exceptions/discovery.py | 4 ++-- keystoneauth1/exceptions/http.py | 4 ++-- keystoneauth1/exceptions/response.py | 2 +- keystoneauth1/exceptions/service_providers.py | 2 +- keystoneauth1/fixture/__init__.py | 4 ++-- keystoneauth1/fixture/discovery.py | 4 ++-- keystoneauth1/identity/__init__.py | 4 ++-- keystoneauth1/identity/generic/__init__.py | 4 ++-- keystoneauth1/identity/v3/__init__.py | 4 ++-- keystoneauth1/identity/v3/base.py | 2 +- keystoneauth1/identity/v3/federation.py | 2 +- keystoneauth1/identity/v3/k2k.py | 2 +- keystoneauth1/identity/v3/oidc.py | 4 ++-- keystoneauth1/identity/v3/password.py | 2 +- keystoneauth1/identity/v3/token.py | 2 +- keystoneauth1/loading/__init__.py | 4 ++-- keystoneauth1/loading/base.py | 4 ++-- keystoneauth1/loading/cli.py | 4 ++-- keystoneauth1/loading/conf.py | 4 ++-- keystoneauth1/loading/opts.py | 2 +- keystoneauth1/loading/session.py | 4 ++-- 27 files changed, 45 insertions(+), 45 deletions(-) diff --git a/keystoneauth1/access/__init__.py b/keystoneauth1/access/__init__.py index 3d1a48bd..273d9cdd 100644 --- a/keystoneauth1/access/__init__.py +++ b/keystoneauth1/access/__init__.py @@ -13,7 +13,7 @@ from keystoneauth1.access.access import * # noqa -__all__ = ['AccessInfo', +__all__ = ('AccessInfo', 'AccessInfoV2', 'AccessInfoV3', - 'create'] + 'create') diff --git a/keystoneauth1/access/access.py b/keystoneauth1/access/access.py index e0ac6b2a..ffb6b9c8 100644 --- a/keystoneauth1/access/access.py +++ b/keystoneauth1/access/access.py @@ -25,10 +25,10 @@ from keystoneauth1.access import service_providers STALE_TOKEN_DURATION = 30 -__all__ = ['AccessInfo', +__all__ = ('AccessInfo', 'AccessInfoV2', 'AccessInfoV3', - 'create'] + 'create') @utils.positional() diff --git a/keystoneauth1/exceptions/auth_plugins.py b/keystoneauth1/exceptions/auth_plugins.py index 8d129906..fd3c60c9 100644 --- a/keystoneauth1/exceptions/auth_plugins.py +++ b/keystoneauth1/exceptions/auth_plugins.py @@ -13,12 +13,12 @@ from keystoneauth1.exceptions import base -__all__ = ['AuthPluginException', +__all__ = ('AuthPluginException', 'MissingAuthPlugin', 'NoMatchingPlugin', 'UnsupportedParameters', 'OptionError', - 'MissingRequiredOptions'] + 'MissingRequiredOptions') class AuthPluginException(base.ClientException): diff --git a/keystoneauth1/exceptions/base.py b/keystoneauth1/exceptions/base.py index 88da4f10..873b9148 100644 --- a/keystoneauth1/exceptions/base.py +++ b/keystoneauth1/exceptions/base.py @@ -11,7 +11,7 @@ # under the License. -__all__ = ['ClientException'] +__all__ = ('ClientException',) class ClientException(Exception): diff --git a/keystoneauth1/exceptions/catalog.py b/keystoneauth1/exceptions/catalog.py index 4158e8e4..25b6005c 100644 --- a/keystoneauth1/exceptions/catalog.py +++ b/keystoneauth1/exceptions/catalog.py @@ -13,9 +13,9 @@ from keystoneauth1.exceptions import base -__all__ = ['CatalogException', +__all__ = ('CatalogException', 'EmptyCatalog', - 'EndpointNotFound'] + 'EndpointNotFound') class CatalogException(base.ClientException): diff --git a/keystoneauth1/exceptions/connection.py b/keystoneauth1/exceptions/connection.py index 769a875d..d98925f1 100644 --- a/keystoneauth1/exceptions/connection.py +++ b/keystoneauth1/exceptions/connection.py @@ -13,12 +13,12 @@ from keystoneauth1.exceptions import base -__all__ = ['ConnectionError', +__all__ = ('ConnectionError', 'ConnectTimeout', 'ConnectFailure', 'SSLError', 'RetriableConnectionFailure', - 'UnknownConnectionError'] + 'UnknownConnectionError') class RetriableConnectionFailure(Exception): diff --git a/keystoneauth1/exceptions/discovery.py b/keystoneauth1/exceptions/discovery.py index ee7c16d0..209009b4 100644 --- a/keystoneauth1/exceptions/discovery.py +++ b/keystoneauth1/exceptions/discovery.py @@ -13,8 +13,8 @@ from keystoneauth1.exceptions import base -__all__ = ['DiscoveryFailure', - 'VersionNotAvailable'] +__all__ = ('DiscoveryFailure', + 'VersionNotAvailable') class DiscoveryFailure(base.ClientException): diff --git a/keystoneauth1/exceptions/http.py b/keystoneauth1/exceptions/http.py index 62e42094..04b68579 100644 --- a/keystoneauth1/exceptions/http.py +++ b/keystoneauth1/exceptions/http.py @@ -28,7 +28,7 @@ import six from keystoneauth1.exceptions import base -__all__ = ['HttpError', +__all__ = ('HttpError', 'HTTPClientError', 'BadRequest', @@ -59,7 +59,7 @@ __all__ = ['HttpError', 'GatewayTimeout', 'HttpVersionNotSupported', - 'from_response'] + 'from_response') class HttpError(base.ClientException): diff --git a/keystoneauth1/exceptions/response.py b/keystoneauth1/exceptions/response.py index 8095dca4..0707eda1 100644 --- a/keystoneauth1/exceptions/response.py +++ b/keystoneauth1/exceptions/response.py @@ -14,7 +14,7 @@ from keystoneauth1.exceptions import base -__all__ = ['InvalidResponse'] +__all__ = ('InvalidResponse',) class InvalidResponse(base.ClientException): diff --git a/keystoneauth1/exceptions/service_providers.py b/keystoneauth1/exceptions/service_providers.py index 015da6f6..a033e8dc 100644 --- a/keystoneauth1/exceptions/service_providers.py +++ b/keystoneauth1/exceptions/service_providers.py @@ -12,7 +12,7 @@ from keystoneauth1.exceptions import base -__all__ = ['ServiceProviderNotFound'] +__all__ = ('ServiceProviderNotFound',) class ServiceProviderNotFound(base.ClientException): diff --git a/keystoneauth1/fixture/__init__.py b/keystoneauth1/fixture/__init__.py index c466d3ce..9035c5ef 100644 --- a/keystoneauth1/fixture/__init__.py +++ b/keystoneauth1/fixture/__init__.py @@ -32,11 +32,11 @@ V2Token = v2.Token V3Token = v3.Token V3FederationToken = v3.V3FederationToken -__all__ = ['DiscoveryList', +__all__ = ('DiscoveryList', 'FixtureValidationError', 'V2Discovery', 'V3Discovery', 'V2Token', 'V3Token', 'V3FederationToken', - ] + ) diff --git a/keystoneauth1/fixture/discovery.py b/keystoneauth1/fixture/discovery.py index d11e056c..702b88b6 100644 --- a/keystoneauth1/fixture/discovery.py +++ b/keystoneauth1/fixture/discovery.py @@ -12,10 +12,10 @@ from keystoneauth1 import _utils as utils -__all__ = ['DiscoveryList', +__all__ = ('DiscoveryList', 'V2Discovery', 'V3Discovery', - ] + ) _DEFAULT_DAYS_AGO = 30 diff --git a/keystoneauth1/identity/__init__.py b/keystoneauth1/identity/__init__.py index 20eaa135..6ad88e41 100644 --- a/keystoneauth1/identity/__init__.py +++ b/keystoneauth1/identity/__init__.py @@ -31,7 +31,7 @@ Token = generic.Token V3OidcPassword = oidc.OidcPassword V3OidcAuthorizationCode = oidc.OidcAuthorizationCode -__all__ = ['BaseIdentityPlugin', +__all__ = ('BaseIdentityPlugin', 'Password', 'Token', 'V2Password', @@ -39,4 +39,4 @@ __all__ = ['BaseIdentityPlugin', 'V3Password', 'V3Token', 'V3OidcPassword', - 'V3OidcAuthorizationCode'] + 'V3OidcAuthorizationCode') diff --git a/keystoneauth1/identity/generic/__init__.py b/keystoneauth1/identity/generic/__init__.py index 51d9f729..df1831e3 100644 --- a/keystoneauth1/identity/generic/__init__.py +++ b/keystoneauth1/identity/generic/__init__.py @@ -15,7 +15,7 @@ from keystoneauth1.identity.generic.password import Password # noqa from keystoneauth1.identity.generic.token import Token # noqa -__all__ = ['BaseGenericPlugin', +__all__ = ('BaseGenericPlugin', 'Password', 'Token', - ] + ) diff --git a/keystoneauth1/identity/v3/__init__.py b/keystoneauth1/identity/v3/__init__.py index 5cddd6ba..c4b6ce9a 100644 --- a/keystoneauth1/identity/v3/__init__.py +++ b/keystoneauth1/identity/v3/__init__.py @@ -18,7 +18,7 @@ from keystoneauth1.identity.v3.token import * # noqa from keystoneauth1.identity.v3.oidc import * # noqa -__all__ = ['Auth', +__all__ = ('Auth', 'AuthConstructor', 'AuthMethod', 'BaseAuth', @@ -34,4 +34,4 @@ __all__ = ['Auth', 'TokenMethod' 'OidcAuthorizationCode', - 'OidcPassword'] + 'OidcPassword') diff --git a/keystoneauth1/identity/v3/base.py b/keystoneauth1/identity/v3/base.py index bfc9f28c..66eaf1f8 100644 --- a/keystoneauth1/identity/v3/base.py +++ b/keystoneauth1/identity/v3/base.py @@ -21,7 +21,7 @@ from keystoneauth1.identity import base _logger = utils.get_logger(__name__) -__all__ = ['Auth', 'AuthMethod', 'AuthConstructor', 'BaseAuth'] +__all__ = ('Auth', 'AuthMethod', 'AuthConstructor', 'BaseAuth') @six.add_metaclass(abc.ABCMeta) diff --git a/keystoneauth1/identity/v3/federation.py b/keystoneauth1/identity/v3/federation.py index ad97ba36..5ee92a30 100644 --- a/keystoneauth1/identity/v3/federation.py +++ b/keystoneauth1/identity/v3/federation.py @@ -17,7 +17,7 @@ import six from keystoneauth1.identity.v3 import base from keystoneauth1.identity.v3 import token -__all__ = ['FederationBaseAuth'] +__all__ = ('FederationBaseAuth',) @six.add_metaclass(abc.ABCMeta) diff --git a/keystoneauth1/identity/v3/k2k.py b/keystoneauth1/identity/v3/k2k.py index 212d6643..30c9900d 100644 --- a/keystoneauth1/identity/v3/k2k.py +++ b/keystoneauth1/identity/v3/k2k.py @@ -19,7 +19,7 @@ from keystoneauth1.identity.v3 import base from keystoneauth1.identity.v3 import token from keystoneauth1 import plugin -__all__ = ['Keystone2Keystone'] +__all__ = ('Keystone2Keystone',) class Keystone2Keystone(base.BaseAuth): diff --git a/keystoneauth1/identity/v3/oidc.py b/keystoneauth1/identity/v3/oidc.py index f54d308f..c85288a9 100644 --- a/keystoneauth1/identity/v3/oidc.py +++ b/keystoneauth1/identity/v3/oidc.py @@ -14,8 +14,8 @@ from keystoneauth1 import _utils from keystoneauth1 import access from keystoneauth1.identity.v3 import federation -__all__ = ['OidcAuthorizationCode', - 'OidcPassword'] +__all__ = ('OidcAuthorizationCode', + 'OidcPassword') class _OidcBase(federation.FederationBaseAuth): diff --git a/keystoneauth1/identity/v3/password.py b/keystoneauth1/identity/v3/password.py index b89ce843..8181bd4a 100644 --- a/keystoneauth1/identity/v3/password.py +++ b/keystoneauth1/identity/v3/password.py @@ -13,7 +13,7 @@ from keystoneauth1.identity.v3 import base -__all__ = ['PasswordMethod', 'Password'] +__all__ = ('PasswordMethod', 'Password') class PasswordMethod(base.AuthMethod): diff --git a/keystoneauth1/identity/v3/token.py b/keystoneauth1/identity/v3/token.py index e9e08414..c5e8ee23 100644 --- a/keystoneauth1/identity/v3/token.py +++ b/keystoneauth1/identity/v3/token.py @@ -13,7 +13,7 @@ from keystoneauth1.identity.v3 import base -__all__ = ['TokenMethod', 'Token'] +__all__ = ('TokenMethod', 'Token') class TokenMethod(base.AuthMethod): diff --git a/keystoneauth1/loading/__init__.py b/keystoneauth1/loading/__init__.py index f3ab2ce6..c9718d55 100644 --- a/keystoneauth1/loading/__init__.py +++ b/keystoneauth1/loading/__init__.py @@ -32,7 +32,7 @@ load_session_from_conf_options = session.load_from_conf_options get_session_conf_options = session.get_conf_options -__all__ = [ +__all__ = ( # loading.base 'BaseLoader', 'get_available_plugin_names', @@ -59,4 +59,4 @@ __all__ = [ # loading.opts 'Opt', -] +) diff --git a/keystoneauth1/loading/base.py b/keystoneauth1/loading/base.py index 849dc2e6..711176d8 100644 --- a/keystoneauth1/loading/base.py +++ b/keystoneauth1/loading/base.py @@ -20,12 +20,12 @@ from keystoneauth1 import exceptions PLUGIN_NAMESPACE = 'keystoneauth1.plugin' -__all__ = ['get_available_plugin_names', +__all__ = ('get_available_plugin_names', 'get_available_plugin_loaders', 'get_plugin_loader', 'get_plugin_options', 'BaseLoader', - 'PLUGIN_NAMESPACE'] + 'PLUGIN_NAMESPACE') def get_available_plugin_names(): diff --git a/keystoneauth1/loading/cli.py b/keystoneauth1/loading/cli.py index 9b04c77a..a72099c0 100644 --- a/keystoneauth1/loading/cli.py +++ b/keystoneauth1/loading/cli.py @@ -17,8 +17,8 @@ from keystoneauth1 import _utils as utils from keystoneauth1.loading import base -__all__ = ['register_argparse_arguments', - 'load_from_argparse_arguments'] +__all__ = ('register_argparse_arguments', + 'load_from_argparse_arguments') def _register_plugin_argparse_arguments(parser, plugin): diff --git a/keystoneauth1/loading/conf.py b/keystoneauth1/loading/conf.py index 9d060157..ed3d12e4 100644 --- a/keystoneauth1/loading/conf.py +++ b/keystoneauth1/loading/conf.py @@ -21,10 +21,10 @@ _section_help = 'Config Section from which to load plugin specific options' _AUTH_SECTION_OPT = opts.Opt('auth_section', help=_section_help) -__all__ = ['get_common_conf_options', +__all__ = ('get_common_conf_options', 'get_plugin_conf_options', 'register_conf_options', - 'load_from_conf_options'] + 'load_from_conf_options') def get_common_conf_options(): diff --git a/keystoneauth1/loading/opts.py b/keystoneauth1/loading/opts.py index 5c4eb906..6e46ec54 100644 --- a/keystoneauth1/loading/opts.py +++ b/keystoneauth1/loading/opts.py @@ -21,7 +21,7 @@ except ImportError: from keystoneauth1 import _utils as utils -__all__ = ['Opt'] +__all__ = ('Opt',) class Opt(object): diff --git a/keystoneauth1/loading/session.py b/keystoneauth1/loading/session.py index 05f22bf9..016c4379 100644 --- a/keystoneauth1/loading/session.py +++ b/keystoneauth1/loading/session.py @@ -23,11 +23,11 @@ from keystoneauth1.loading import base from keystoneauth1 import session -__all__ = ['register_argparse_arguments', +__all__ = ('register_argparse_arguments', 'load_from_argparse_arguments', 'register_conf_options', 'load_from_conf_options', - 'get_conf_options'] + 'get_conf_options') def _positive_non_zero_float(argument_value):