diff --git a/oslo/messaging/__init__.py b/oslo/messaging/__init__.py index 6aedbdd96..fb17872ff 100644 --- a/oslo/messaging/__init__.py +++ b/oslo/messaging/__init__.py @@ -13,43 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.messaging import exceptions -from oslo.messaging.rpc import client -from oslo.messaging.rpc import dispatcher as rpc_dispatcher -from oslo.messaging.rpc import server as rpc_server -from oslo.messaging import serializer -from oslo.messaging import server -from oslo.messaging import target -from oslo.messaging import transport - - -get_transport = transport.get_transport -Target = target.Target - -RPCClient = client.RPCClient - -MessageHandlingServer = server.MessageHandlingServer -get_rpc_server = rpc_server.get_rpc_server -RPCDispatcher = rpc_dispatcher.RPCDispatcher -Serializer = serializer.Serializer - - -# -# Exceptions -# -MessagingException = exceptions.MessagingException -MessagingTimeout = exceptions.MessagingTimeout - -DriverLoadFailure = transport.DriverLoadFailure -InvalidTransportURL = transport.InvalidTransportURL - -RPCVersionCapError = client.RPCVersionCapError -ClientSendError = client.ClientSendError - -MessagingServerError = server.MessagingServerError -ExecutorLoadFailure = server.ExecutorLoadFailure -ServerListenError = server.ServerListenError - -RPCDispatcherError = rpc_dispatcher.RPCDispatcherError -NoSuchMethod = rpc_dispatcher.NoSuchMethod -UnsupportedVersion = rpc_dispatcher.UnsupportedVersion +from .exceptions import * +from .rpc import * +from .serializer import * +from .server import * +from .target import * +from .transport import * diff --git a/oslo/messaging/exceptions.py b/oslo/messaging/exceptions.py index 54b123a07..32373c4df 100644 --- a/oslo/messaging/exceptions.py +++ b/oslo/messaging/exceptions.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +__all__ = ['MessagingException', 'MessagingTimeout'] + class MessagingException(Exception): """Base class for exceptions.""" diff --git a/oslo/messaging/rpc/__init__.py b/oslo/messaging/rpc/__init__.py index b1541fdb7..c69e4b083 100644 --- a/oslo/messaging/rpc/__init__.py +++ b/oslo/messaging/rpc/__init__.py @@ -12,3 +12,18 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + +__all__ = [ + 'ClientSendError', + 'NoSuchMethod', + 'RPCClient', + 'RPCDispatcher', + 'RPCDispatcherError', + 'RPCVersionCapError', + 'UnsupportedVersion', + 'get_rpc_server', +] + +from client import * +from dispatcher import * +from server import * diff --git a/oslo/messaging/rpc/client.py b/oslo/messaging/rpc/client.py index a42cdbb00..616a6060e 100644 --- a/oslo/messaging/rpc/client.py +++ b/oslo/messaging/rpc/client.py @@ -16,6 +16,12 @@ # License for the specific language governing permissions and limitations # under the License. +__all__ = [ + 'ClientSendError', + 'RPCClient', + 'RPCVersionCapError', +] + import inspect import logging diff --git a/oslo/messaging/rpc/dispatcher.py b/oslo/messaging/rpc/dispatcher.py index 128f7b80b..bcf0864a8 100644 --- a/oslo/messaging/rpc/dispatcher.py +++ b/oslo/messaging/rpc/dispatcher.py @@ -16,6 +16,13 @@ # License for the specific language governing permissions and limitations # under the License. +__all__ = [ + 'NoSuchMethod', + 'RPCDispatcher', + 'RPCDispatcherError', + 'UnsupportedVersion', +] + import logging from oslo.messaging import _utils as utils diff --git a/oslo/messaging/rpc/server.py b/oslo/messaging/rpc/server.py index 6942da2a8..53eb8d103 100644 --- a/oslo/messaging/rpc/server.py +++ b/oslo/messaging/rpc/server.py @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +__all__ = ['get_rpc_server'] + from oslo.messaging.rpc import dispatcher as rpc_dispatcher from oslo.messaging import server as msg_server diff --git a/oslo/messaging/serializer.py b/oslo/messaging/serializer.py index feec0934d..e9248ccf3 100644 --- a/oslo/messaging/serializer.py +++ b/oslo/messaging/serializer.py @@ -12,6 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +__all__ = ['Serializer', 'NoOpSerializer'] + """Provides the definition of a message serialization handler""" import abc diff --git a/oslo/messaging/server.py b/oslo/messaging/server.py index 369778087..6ef22f7b6 100644 --- a/oslo/messaging/server.py +++ b/oslo/messaging/server.py @@ -16,6 +16,13 @@ # License for the specific language governing permissions and limitations # under the License. +__all__ = [ + 'ExecutorLoadFailure', + 'MessageHandlingServer', + 'MessagingServerError', + 'ServerListenError', +] + import logging from stevedore import driver diff --git a/oslo/messaging/transport.py b/oslo/messaging/transport.py index 93247a0f5..d27dc1430 100644 --- a/oslo/messaging/transport.py +++ b/oslo/messaging/transport.py @@ -16,6 +16,14 @@ # License for the specific language governing permissions and limitations # under the License. +__all__ = [ + 'DriverLoadFailure', + 'InvalidTransportURL', + 'Transport', + 'get_transport', + 'set_transport_defaults', +] + import urlparse from oslo.config import cfg @@ -42,7 +50,7 @@ _transport_opts = [ ] -def set_defaults(control_exchange): +def set_transport_defaults(control_exchange): """Set defaults for messaging transport configuration options. :param control_exchange: the default exchange under which topics are scoped diff --git a/tests/test_transport.py b/tests/test_transport.py index cf2f9ca95..83b0dda23 100644 --- a/tests/test_transport.py +++ b/tests/test_transport.py @@ -209,12 +209,12 @@ class TestSetDefaults(test_utils.BaseTestCase): def setUp(self): super(TestSetDefaults, self).setUp(conf=cfg.ConfigOpts()) - self.useFixture(_SetDefaultsFixture(transport.set_defaults, + self.useFixture(_SetDefaultsFixture(messaging.set_transport_defaults, transport._transport_opts, 'control_exchange')) def test_set_default_control_exchange(self): - transport.set_defaults(control_exchange='foo') + messaging.set_transport_defaults(control_exchange='foo') self.mox.StubOutWithMock(driver, 'DriverManager') invoke_kwds = mox.ContainsKeyValue('default_exchange', 'foo') diff --git a/tox.ini b/tox.ini index 4e9eac12a..0768c111a 100644 --- a/tox.ini +++ b/tox.ini @@ -20,5 +20,5 @@ commands = {posargs} [flake8] show-source = True -exclude = .tox,dist,doc,*.egg,build +exclude = .tox,dist,doc,*.egg,build,__init__.py builtins = _