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:
parent
4ee46e58f7
commit
10c5961426
@ -13,7 +13,7 @@
|
|||||||
from keystoneauth1.access.access import * # noqa
|
from keystoneauth1.access.access import * # noqa
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['AccessInfo',
|
__all__ = ('AccessInfo',
|
||||||
'AccessInfoV2',
|
'AccessInfoV2',
|
||||||
'AccessInfoV3',
|
'AccessInfoV3',
|
||||||
'create']
|
'create')
|
||||||
|
@ -25,10 +25,10 @@ from keystoneauth1.access import service_providers
|
|||||||
STALE_TOKEN_DURATION = 30
|
STALE_TOKEN_DURATION = 30
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['AccessInfo',
|
__all__ = ('AccessInfo',
|
||||||
'AccessInfoV2',
|
'AccessInfoV2',
|
||||||
'AccessInfoV3',
|
'AccessInfoV3',
|
||||||
'create']
|
'create')
|
||||||
|
|
||||||
|
|
||||||
@utils.positional()
|
@utils.positional()
|
||||||
|
@ -13,12 +13,12 @@
|
|||||||
from keystoneauth1.exceptions import base
|
from keystoneauth1.exceptions import base
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['AuthPluginException',
|
__all__ = ('AuthPluginException',
|
||||||
'MissingAuthPlugin',
|
'MissingAuthPlugin',
|
||||||
'NoMatchingPlugin',
|
'NoMatchingPlugin',
|
||||||
'UnsupportedParameters',
|
'UnsupportedParameters',
|
||||||
'OptionError',
|
'OptionError',
|
||||||
'MissingRequiredOptions']
|
'MissingRequiredOptions')
|
||||||
|
|
||||||
|
|
||||||
class AuthPluginException(base.ClientException):
|
class AuthPluginException(base.ClientException):
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['ClientException']
|
__all__ = ('ClientException',)
|
||||||
|
|
||||||
|
|
||||||
class ClientException(Exception):
|
class ClientException(Exception):
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
|
|
||||||
from keystoneauth1.exceptions import base
|
from keystoneauth1.exceptions import base
|
||||||
|
|
||||||
__all__ = ['CatalogException',
|
__all__ = ('CatalogException',
|
||||||
'EmptyCatalog',
|
'EmptyCatalog',
|
||||||
'EndpointNotFound']
|
'EndpointNotFound')
|
||||||
|
|
||||||
|
|
||||||
class CatalogException(base.ClientException):
|
class CatalogException(base.ClientException):
|
||||||
|
@ -13,12 +13,12 @@
|
|||||||
from keystoneauth1.exceptions import base
|
from keystoneauth1.exceptions import base
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['ConnectionError',
|
__all__ = ('ConnectionError',
|
||||||
'ConnectTimeout',
|
'ConnectTimeout',
|
||||||
'ConnectFailure',
|
'ConnectFailure',
|
||||||
'SSLError',
|
'SSLError',
|
||||||
'RetriableConnectionFailure',
|
'RetriableConnectionFailure',
|
||||||
'UnknownConnectionError']
|
'UnknownConnectionError')
|
||||||
|
|
||||||
|
|
||||||
class RetriableConnectionFailure(Exception):
|
class RetriableConnectionFailure(Exception):
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
from keystoneauth1.exceptions import base
|
from keystoneauth1.exceptions import base
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['DiscoveryFailure',
|
__all__ = ('DiscoveryFailure',
|
||||||
'VersionNotAvailable']
|
'VersionNotAvailable')
|
||||||
|
|
||||||
|
|
||||||
class DiscoveryFailure(base.ClientException):
|
class DiscoveryFailure(base.ClientException):
|
||||||
|
@ -28,7 +28,7 @@ import six
|
|||||||
from keystoneauth1.exceptions import base
|
from keystoneauth1.exceptions import base
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['HttpError',
|
__all__ = ('HttpError',
|
||||||
|
|
||||||
'HTTPClientError',
|
'HTTPClientError',
|
||||||
'BadRequest',
|
'BadRequest',
|
||||||
@ -59,7 +59,7 @@ __all__ = ['HttpError',
|
|||||||
'GatewayTimeout',
|
'GatewayTimeout',
|
||||||
'HttpVersionNotSupported',
|
'HttpVersionNotSupported',
|
||||||
|
|
||||||
'from_response']
|
'from_response')
|
||||||
|
|
||||||
|
|
||||||
class HttpError(base.ClientException):
|
class HttpError(base.ClientException):
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
from keystoneauth1.exceptions import base
|
from keystoneauth1.exceptions import base
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['InvalidResponse']
|
__all__ = ('InvalidResponse',)
|
||||||
|
|
||||||
|
|
||||||
class InvalidResponse(base.ClientException):
|
class InvalidResponse(base.ClientException):
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
from keystoneauth1.exceptions import base
|
from keystoneauth1.exceptions import base
|
||||||
|
|
||||||
__all__ = ['ServiceProviderNotFound']
|
__all__ = ('ServiceProviderNotFound',)
|
||||||
|
|
||||||
|
|
||||||
class ServiceProviderNotFound(base.ClientException):
|
class ServiceProviderNotFound(base.ClientException):
|
||||||
|
@ -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',
|
||||||
]
|
)
|
||||||
|
@ -12,10 +12,10 @@
|
|||||||
|
|
||||||
from keystoneauth1 import _utils as utils
|
from keystoneauth1 import _utils as utils
|
||||||
|
|
||||||
__all__ = ['DiscoveryList',
|
__all__ = ('DiscoveryList',
|
||||||
'V2Discovery',
|
'V2Discovery',
|
||||||
'V3Discovery',
|
'V3Discovery',
|
||||||
]
|
)
|
||||||
|
|
||||||
_DEFAULT_DAYS_AGO = 30
|
_DEFAULT_DAYS_AGO = 30
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ Token = generic.Token
|
|||||||
V3OidcPassword = oidc.OidcPassword
|
V3OidcPassword = oidc.OidcPassword
|
||||||
V3OidcAuthorizationCode = oidc.OidcAuthorizationCode
|
V3OidcAuthorizationCode = oidc.OidcAuthorizationCode
|
||||||
|
|
||||||
__all__ = ['BaseIdentityPlugin',
|
__all__ = ('BaseIdentityPlugin',
|
||||||
'Password',
|
'Password',
|
||||||
'Token',
|
'Token',
|
||||||
'V2Password',
|
'V2Password',
|
||||||
@ -39,4 +39,4 @@ __all__ = ['BaseIdentityPlugin',
|
|||||||
'V3Password',
|
'V3Password',
|
||||||
'V3Token',
|
'V3Token',
|
||||||
'V3OidcPassword',
|
'V3OidcPassword',
|
||||||
'V3OidcAuthorizationCode']
|
'V3OidcAuthorizationCode')
|
||||||
|
@ -15,7 +15,7 @@ from keystoneauth1.identity.generic.password import Password # noqa
|
|||||||
from keystoneauth1.identity.generic.token import Token # noqa
|
from keystoneauth1.identity.generic.token import Token # noqa
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['BaseGenericPlugin',
|
__all__ = ('BaseGenericPlugin',
|
||||||
'Password',
|
'Password',
|
||||||
'Token',
|
'Token',
|
||||||
]
|
)
|
||||||
|
@ -18,7 +18,7 @@ from keystoneauth1.identity.v3.token import * # noqa
|
|||||||
from keystoneauth1.identity.v3.oidc import * # noqa
|
from keystoneauth1.identity.v3.oidc import * # noqa
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['Auth',
|
__all__ = ('Auth',
|
||||||
'AuthConstructor',
|
'AuthConstructor',
|
||||||
'AuthMethod',
|
'AuthMethod',
|
||||||
'BaseAuth',
|
'BaseAuth',
|
||||||
@ -34,4 +34,4 @@ __all__ = ['Auth',
|
|||||||
'TokenMethod'
|
'TokenMethod'
|
||||||
|
|
||||||
'OidcAuthorizationCode',
|
'OidcAuthorizationCode',
|
||||||
'OidcPassword']
|
'OidcPassword')
|
||||||
|
@ -21,7 +21,7 @@ from keystoneauth1.identity import base
|
|||||||
|
|
||||||
_logger = utils.get_logger(__name__)
|
_logger = utils.get_logger(__name__)
|
||||||
|
|
||||||
__all__ = ['Auth', 'AuthMethod', 'AuthConstructor', 'BaseAuth']
|
__all__ = ('Auth', 'AuthMethod', 'AuthConstructor', 'BaseAuth')
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
|
@ -17,7 +17,7 @@ import six
|
|||||||
from keystoneauth1.identity.v3 import base
|
from keystoneauth1.identity.v3 import base
|
||||||
from keystoneauth1.identity.v3 import token
|
from keystoneauth1.identity.v3 import token
|
||||||
|
|
||||||
__all__ = ['FederationBaseAuth']
|
__all__ = ('FederationBaseAuth',)
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
|
@ -19,7 +19,7 @@ from keystoneauth1.identity.v3 import base
|
|||||||
from keystoneauth1.identity.v3 import token
|
from keystoneauth1.identity.v3 import token
|
||||||
from keystoneauth1 import plugin
|
from keystoneauth1 import plugin
|
||||||
|
|
||||||
__all__ = ['Keystone2Keystone']
|
__all__ = ('Keystone2Keystone',)
|
||||||
|
|
||||||
|
|
||||||
class Keystone2Keystone(base.BaseAuth):
|
class Keystone2Keystone(base.BaseAuth):
|
||||||
|
@ -14,8 +14,8 @@ from keystoneauth1 import _utils
|
|||||||
from keystoneauth1 import access
|
from keystoneauth1 import access
|
||||||
from keystoneauth1.identity.v3 import federation
|
from keystoneauth1.identity.v3 import federation
|
||||||
|
|
||||||
__all__ = ['OidcAuthorizationCode',
|
__all__ = ('OidcAuthorizationCode',
|
||||||
'OidcPassword']
|
'OidcPassword')
|
||||||
|
|
||||||
|
|
||||||
class _OidcBase(federation.FederationBaseAuth):
|
class _OidcBase(federation.FederationBaseAuth):
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
from keystoneauth1.identity.v3 import base
|
from keystoneauth1.identity.v3 import base
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['PasswordMethod', 'Password']
|
__all__ = ('PasswordMethod', 'Password')
|
||||||
|
|
||||||
|
|
||||||
class PasswordMethod(base.AuthMethod):
|
class PasswordMethod(base.AuthMethod):
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
from keystoneauth1.identity.v3 import base
|
from keystoneauth1.identity.v3 import base
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['TokenMethod', 'Token']
|
__all__ = ('TokenMethod', 'Token')
|
||||||
|
|
||||||
|
|
||||||
class TokenMethod(base.AuthMethod):
|
class TokenMethod(base.AuthMethod):
|
||||||
|
@ -32,7 +32,7 @@ load_session_from_conf_options = session.load_from_conf_options
|
|||||||
get_session_conf_options = session.get_conf_options
|
get_session_conf_options = session.get_conf_options
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = (
|
||||||
# loading.base
|
# loading.base
|
||||||
'BaseLoader',
|
'BaseLoader',
|
||||||
'get_available_plugin_names',
|
'get_available_plugin_names',
|
||||||
@ -59,4 +59,4 @@ __all__ = [
|
|||||||
|
|
||||||
# loading.opts
|
# loading.opts
|
||||||
'Opt',
|
'Opt',
|
||||||
]
|
)
|
||||||
|
@ -20,12 +20,12 @@ from keystoneauth1 import exceptions
|
|||||||
PLUGIN_NAMESPACE = 'keystoneauth1.plugin'
|
PLUGIN_NAMESPACE = 'keystoneauth1.plugin'
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['get_available_plugin_names',
|
__all__ = ('get_available_plugin_names',
|
||||||
'get_available_plugin_loaders',
|
'get_available_plugin_loaders',
|
||||||
'get_plugin_loader',
|
'get_plugin_loader',
|
||||||
'get_plugin_options',
|
'get_plugin_options',
|
||||||
'BaseLoader',
|
'BaseLoader',
|
||||||
'PLUGIN_NAMESPACE']
|
'PLUGIN_NAMESPACE')
|
||||||
|
|
||||||
|
|
||||||
def get_available_plugin_names():
|
def get_available_plugin_names():
|
||||||
|
@ -17,8 +17,8 @@ from keystoneauth1 import _utils as utils
|
|||||||
from keystoneauth1.loading import base
|
from keystoneauth1.loading import base
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['register_argparse_arguments',
|
__all__ = ('register_argparse_arguments',
|
||||||
'load_from_argparse_arguments']
|
'load_from_argparse_arguments')
|
||||||
|
|
||||||
|
|
||||||
def _register_plugin_argparse_arguments(parser, plugin):
|
def _register_plugin_argparse_arguments(parser, plugin):
|
||||||
|
@ -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)
|
_AUTH_SECTION_OPT = opts.Opt('auth_section', help=_section_help)
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['get_common_conf_options',
|
__all__ = ('get_common_conf_options',
|
||||||
'get_plugin_conf_options',
|
'get_plugin_conf_options',
|
||||||
'register_conf_options',
|
'register_conf_options',
|
||||||
'load_from_conf_options']
|
'load_from_conf_options')
|
||||||
|
|
||||||
|
|
||||||
def get_common_conf_options():
|
def get_common_conf_options():
|
||||||
|
@ -21,7 +21,7 @@ except ImportError:
|
|||||||
from keystoneauth1 import _utils as utils
|
from keystoneauth1 import _utils as utils
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['Opt']
|
__all__ = ('Opt',)
|
||||||
|
|
||||||
|
|
||||||
class Opt(object):
|
class Opt(object):
|
||||||
|
@ -23,11 +23,11 @@ from keystoneauth1.loading import base
|
|||||||
from keystoneauth1 import session
|
from keystoneauth1 import session
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['register_argparse_arguments',
|
__all__ = ('register_argparse_arguments',
|
||||||
'load_from_argparse_arguments',
|
'load_from_argparse_arguments',
|
||||||
'register_conf_options',
|
'register_conf_options',
|
||||||
'load_from_conf_options',
|
'load_from_conf_options',
|
||||||
'get_conf_options']
|
'get_conf_options')
|
||||||
|
|
||||||
|
|
||||||
def _positive_non_zero_float(argument_value):
|
def _positive_non_zero_float(argument_value):
|
||||||
|
Loading…
Reference in New Issue
Block a user