12 Commits

Author SHA1 Message Date
Doug Hellmann
3b6ca5b6de Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: I05a408b76d4f31b803769a27759e91df770511bb
2015-06-19 18:06:50 +00:00
Doug Hellmann
e55a83e832 Move files out of the namespace package
Move the public API out of oslo.messaging to oslo_messaging. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.

bp/drop-namespace-packages

Co-authored-by: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
Change-Id: Ia562010c152a214f1c0fed767c82022c7c2c52e7
2015-01-12 12:50:41 -05:00
Julien Danjou
8d242bd7ab Switch to oslo.serialization
Change-Id: I24be947cfc2d9ce60e65054e6562e544b1e21195
2014-09-23 14:54:30 +02:00
ChangBo Guo(gcb)
a7450229f8 Trival:Fix assertEqual arguments order
assertEqual method's arguments should be in ('expected', 'actual')
order.

Change-Id: I35f045a9d3a6e7f083fb137c751eeab52c77000b
Closes-bug: 1277104
2014-04-02 17:40:34 +08:00
Jenkins
f3e03c9fff Merge "Minor Python 3 fixes" 2014-01-08 18:37:39 +00:00
Victor Stinner
690868bc99 Minor Python 3 fixes
basestring does not exist anymore in Python 3: use six.string_types instead.

In "try: .../except Exception as err: ...", err is a local variable, it does no
more exist after the except block. Copy the exception in a new cls_error
variable to fix Python 3 support.

Extract of Python 3 documentation: "When an exception has been assigned using
as target, it is cleared at the end of the except clause. (...) Exceptions are
cleared because with the traceback attached to them, they form a reference
cycle with the stack frame, keeping all locals in that frame alive until the
next garbage collection occurs."

http://docs.python.org/3.3/reference/compound_stmts.html#try

Change-Id: I2efb14b3838f78d1ed5e09b3ccd4e796a3448aee
2014-01-07 11:29:13 +01:00
Victor Stinner
fb5ace04ba Fix exception deserialiation on Python 3
Builtin exceptions are now in the builtins module, the exceptions module has
been removed.

Fix also the unit test for tracebacks, Unicode representation doesn't start
with "u" prefix anymore (u'...').

Change-Id: I422be457e23066699950c9a3999878ecf65f1b3f
2013-12-19 14:51:17 +01:00
Julien Danjou
2b9bafd269 Simplify common base exception prototype
It seems there's no gain in trying to be smarter and different from the
base Python Exception, so let's remove our custom code to be more
compatible and friendly with all Python versions.

Change-Id: I259783ef1f77c6661ea7dc2325605c8d6290b898
2013-12-03 11:23:17 +01:00
Mark McLoughlin
ac2176cde3 Add a per-transport allow_remote_exmods API
Currently we have a allowed_rpc_exception_modules configuration variable
which we use to configure a per-project list of modules which we will
allow exceptions to be instantiated from when deserializing remote
errors.

It makes no sense for this to be user configurable, instead the list of
modules should be set when you create a transport.

Closes-Bug: #1031719
Change-Id: Ib40e92cb920996ec5e8f63d6f2cbd88fd01a90f2
2013-08-07 13:11:46 +01:00
Mark McLoughlin
66f597f30d Expose RemoteError exception in the public API
If a remote endpoint raises an exception which the client is not allowed
to (or cannot) deserialize, then RPCClient.call() raises a RemoteError
exception instead.

Make this exception type part of the public API.

Change-Id: I70be0ab7d40af3224d93d6bd0522c1a82f6303c3
2013-08-07 12:52:58 +01:00
Mark McLoughlin
cb2623f46e Use testtools.TestCase assertion methods
I typically avoided using e.g. assertIsNone() thinking we couldn't use
it on 2.7, but now that we use testtools.TestCast there are a bunch of
useful assertion methods we can use.

Change-Id: I7696dc4744cdfd2466773326f202bc08dcfcbf0f
2013-08-07 06:43:55 +01:00
Mark McLoughlin
7d16c76b23 Add exception serialization tests
These are pretty comprehensive tests for the exception serialization
code. The code itself code do with a bunch of refactoring, but that will
come later.

The main TODO item is that we need a way for users of the API to
register the list of modules that it wants to allow exceptions to be
deserialized from. There is no need for this to be an end-user
configuration option, but we do need each service to be able to specify
its own list.

Change-Id: Ib2fc3f1ca5da708b41bdc00e8ac6ce0c92399ce8
2013-07-26 06:55:15 +01:00