Commit Graph

38 Commits

Author SHA1 Message Date
Doug Hellmann 03265410e0 Remove oslo namespace package
Blueprint remove-namespace-packages

Depends-on: I2eeef93ee2e61a721c69f62add819f93f62f077d
for openstack/ceilometer
Depends-on: I26390dd908769be5f1a5b70be22d3b98e3a45563
for openstack/ceilometermiddleware
Depends-on: Ifa8baab33cdb3e606cf175a8c29c3a4ef6c44480
for openstack/glance
Depends-on: I029c3260051aa48cfaae428c096c1ac7b43b2bd2
for openstack/ceilometermiddleware

Change-Id: I8c5595bbafa82db33f62fa47d214f5cb756a2639
2015-07-16 17:47:16 +00:00
Doug Hellmann a6d068a984 Add oslo.messaging._drivers.common for heat tests
Some of the heat unit tests import code from a private part of
oslo.messaging. With the namespace package change, that private part was
no longer being exposed. This change introduces the needed module so we
can release oslo.messaging with the namespace changes without breaking
heat, to give the heat team time to update their tests.

Partial-Bug: #1410196
Change-Id: Ib3ea106646f75b17665877b08ccbd382c5698714
2015-01-13 08:56:36 -05: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
Jenkins 8102f25dd2 Merge "Fix some comments in a backporting review session" 2015-01-08 19:23:39 +00:00
Mehdi Abaakouk 44132d4344 rabbit: fix timeout timer when duration is None
When the duration of the timeout timer used in the rabbit driver.is
None and we want that the timer return a maximum of N secs it return None
(infinite) instead of N.

This change fixes that.

Closes-bug: #1408370

Change-Id: I7f4cb3075f776c63aa7dc497173677f92b68c16d
2015-01-07 21:30:01 +00:00
Mehdi Abaakouk c18f9f7c61 Don't log each received messages
oslo.utils.strutils.mask_password take too much time on
big payload (nova-conductor can receive payload ~ 66k in
largeops jobs for example).

This change removes this logging until we make mask_password
more efficient or we have a smarted the oslo.messaging logging to
not log everything.

Change-Id: Ib1f1d70c5cb820e8ff2de10e6064037808ea1f3a
Closes-bug: #1408362
2015-01-07 18:27:32 +01:00
Jie Li 3e2d142a87 Fix some comments in a backporting review session
* add i18n support to some exception messages
  * remove the return value of DecayingTimer.start()

Relates to review: I898a236a384b3466147026abc7a1ee21801e8ca1

Change-Id: I7adf5478732f1f46db1009b059b66ff8af6ecdc3
2014-12-27 12:01:25 +08:00
Mehdi Abaakouk 56a9c55a3f safe_log Sanitize Passwords in List of Dicts
Sanitizes password fields found in lists of dicts for messages
before logging.

This change uses oslo.utils.strutils.mask_password to do it.

Change-Id: I7cd1e53e2ced7ebf9c5942b7a0dbbeb991acab4d
Closes-Bug: #1268459
2014-12-16 16:17:46 +00:00
Mehdi Abaakouk 023b7f44e2 rabbit: more precise iterconsume timeout
The iterconsume always set the timeout of kombu to 1 second
even the requested timeout more precise or < 1 second.

This change fixes that.

Related bug: #1400268
Related bug: #1399257

Change-Id: I157dab80cdb4afcf9a5f26fa900f96f0696db502
2014-12-08 12:08:01 +01:00
Davanum Srinivas 487bbf5b13 Enable oslo.i18n for oslo.messaging
Change-Id: Ic8e05ae4ffe3eb871ae64243c41a9955f47cbe2a
2014-09-24 22:18:50 -04:00
Julien Danjou 8d242bd7ab Switch to oslo.serialization
Change-Id: I24be947cfc2d9ce60e65054e6562e544b1e21195
2014-09-23 14:54:30 +02:00
jazeltq 93283f2c2d fix memory leak for function _safe_log
In _safe_log it uses recursive closure. The gc can not free stack for
this recursive closure for cycle-reference. So cut down the cycle
to fix it.

Resolved-bug: #1365892
Change-Id: I05fbd7091b886344d76b172a5ad66d9225599d69
2014-09-18 09:26:11 +08:00
Julien Danjou a9ec73f38d Switch to oslo.utils
Change-Id: I262e98d8d03acbe2ff8fee5d607279a669a89e34
2014-08-27 14:14:00 +02:00
Christian Berendt 7fdeddaa3b Replace lambda method _
Instead of the lambda method _ the method should be imported
from oslo.messaging.openstack.common.gettextutils.

Change-Id: I373337cc1227b0d7b7bf93603b53a64de83721a9
2014-08-04 14:25:33 +02:00
Christian Berendt 5be1b6a6a9 Enabled hacking checks H305 and H307
* H305  imports not grouped correctly
* H307  like imports should be grouped together

Change-Id: I08dafc4fa150d2213b2bb002da7c9ee0ee517fac
2014-07-17 12:41:21 +02:00
Jenkins 032639e677 Merge "fixed pep8 issue E265" 2014-07-04 15:58:33 +00:00
Aaron Rosen 0102aa96e6 Replace usage of str() with six.text_type
Replace using of str with six.text_type as it's able to
handle unicode data.

Change-Id: I38e4378c490d1dad8020312308dd3b6dad8772c0
2014-06-25 20:08:51 +00:00
Christian Berendt 409108c74f replace string format arguments with function parameters
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.

Change-Id: I4a7ce6916aefb2f2d445f0ebd977c824b1c51e24
Partial-Bug: #1321274
2014-06-20 14:18:40 +01:00
Mehdi Abaakouk 5ded2dad06 Removes unused config option
This change removes the unused 'allowed_rpc_exception_modules' options

Change-Id: Ibb30709e5a3a08573fc1975fab80498a27b5ef0f
2014-06-11 11:13:09 +02:00
Christian Berendt ab88dfb887 fixed pep8 issue E265
* E265 block comment should start with '# '

E265 was introduced in pep8 1.5 (2014-03-26).

Change-Id: I076addadd2e67a8ac4162c706a36239f4af37a8c
2014-06-08 16:40:08 +00:00
Mehdi Abaakouk fd86e0fd54 Remove old drivers dead code
This patch removes some common helper method/class.
Because they are not used anymore by current amqpdriver.

Change-Id: I183750e158e05cf1d0b5e37725676d4882e0c043
2014-04-03 14:35:34 +00:00
Andreas Jaeger 5a860beb87 Improve help strings
Follow oslo.config style guide for help strings better to create
consistent help strings:
* Capitalize first word of each help string
* Finish help strings with "."

Change-Id: Ia08fa09593661e6e5b834d98bbd92689c2674075
2014-02-07 22:25:09 +01:00
Jenkins 04cb7223a5 Merge "Fix exception deserialiation on Python 3" 2014-01-08 18:35:26 +00:00
Victor Stinner 062c8ac7dd Replace dict.iteritems() with six.iteritems()
dict.iteritems() was replaced with dict.items() in Python 3. Use the
six.iteritems() function to get code compatible with Python 2 and Python 3.

Change-Id: I0c8ecc3ae540ffaf4c6b159e09ca16ccf365973d
2013-12-20 23:43:35 +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
Chang Bo Guo b38b3a3c13 Replace data structures' attribute with six module
In Python 3, some data structures' attribute is different in Python 2.
See http://pythonhosted.org/six/#object-model-compatibility
This is change mapping:

   six               Python 2           Python 3
six.next(it)         it.next()          next(it)
six.iterkeys(dict)   dict.iterkeys()    dict.keys()
six.itervalues(dict) dict.itervalues()  dict.values()

Implements: blueprint make-python3-compatible
Change-Id: Ida48f39ff230860feee7305b93b134c625a21663
2013-12-09 08:17:59 +00:00
Joe Gordon 5d046a5c97 Remove vim header
No need to set tabstop 189 times, this can be set in your vimrc file
instead.  Also if set incorrectly gate (pep8 check) will catch your
mistakes.

Change-Id: Ic6f0c0ef94e8194a5c121598305d1ec3c74e4843
2013-12-03 15:44:24 +00:00
Julien Danjou 97b9deca88 Remove useless global vars / import
This removes a few import and global variables that are not used through
the code. That cleans things a little.

Change-Id: I7b30bb11e8ad3c2df01ca2107eff2444feed3fe2
2013-12-02 15:26:53 +01:00
Chang Bo Guo 0b078b6062 Fix some typos and adjust capitalization
Change-Id: I61cf108f9746fc44a08d83e11d44ed1007a6a1fa
2013-11-03 07:07:51 -08:00
Zhongyue Luo 63f1e0e5ec Removes a redundant version_is_compatible function
Two defined in _drivers.common and _utils.
Removed the one in _drivers.common

Change-Id: I613c2d9288a1bf333dd89c8844bd8467e8b34c42
2013-08-09 07:21:07 +00: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 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
Mark McLoughlin 8ccb5741d2 Remove use of gettextutils
We don't have any infrastructure for localizations in oslo.messaging
so using this is pointless right now. I'm also generally not convinced
we want to translate any of the strings in this library anyway.

For now, just add a dummy _() function. We can can unmark the strings
later.

Change-Id: I1b6a698ee5558c50dc5eafee1f5f05ee2570435e
2013-07-24 08:15:35 +01:00
Mark McLoughlin c891e7ee24 Remove use of openstack.common.local
This means we no longer set the request context for the current thread
so that it can be used in logging.

We do need to add this back later, but it might be in the form of a
get_current_context() method.

Change-Id: I3f08a85e2019affddec829e2ea008b5c10707660
2013-07-24 08:15:35 +01:00
Mark McLoughlin 1a7e51eb4a Use stdlib logging
I guess this loses us automatic logging of details from request context.

Change-Id: I7413f025231c14b7cbdc9e90099407bc6c7943e1
2013-07-24 08:15:35 +01:00
Mark McLoughlin 04dd4e1773 Adjust imports in rabbit/qpid drivers
Some modules are in oslo.messaging.openstack.common and others are in
oslo.messaging._drivers.

Change-Id: I3581eff3427858c8f46673e4a3c376367c626bb3
2013-07-24 08:15:34 +01:00
Mark McLoughlin e91dbef454 Add oslo-incubator code unmodified
I want to make it absolutely clear what changes we're making from the
original driver code, so let's start with a pristine copy.

Change-Id: I38507382b1ce68c7f8f697522f9a1bf00e76532d
2013-07-23 18:34:42 +01:00