Commit Graph

15 Commits

Author SHA1 Message Date
Mehdi Abaakouk fec77dbc85 Permit usage of notifications for metering
This patch introduces a new publisher that uses notification instead
of RPC.

And set it by default.

Closes bug: #1005933
Implements blueprint replace-rpc-cast-with-notifications
Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>

Change-Id: Idc40c148ef60d5e1349d30c66ba85691d93c5675
2014-08-27 11:24:24 +02:00
Julien Danjou 14b4cdbb51 Switch to oslo.utils
Change-Id: Iacfcbf49864198915f8c229bc552afb412b83b79
2014-08-22 14:52:13 +02:00
Julien Danjou b6e01687af Switch to oslotest
Change-Id: I8fb8755f289521b928b1dee2605d310e788f73c7
2014-08-21 11:42:15 +02:00
Igor Degtiarov f67bce40fb Fix H405 violations and re-enable gating
H405 is a new rule in hacking 0.9, so fix new violations and
re-enable gating.

Change-Id: I61541fa0a9dc18ad938df54d56c65c972b151622
2014-07-01 13:41:27 +03:00
Igor Degtiarov 92a08daa31 Fix H904 violations and re-enable gating
H904 got stricter in hacking 0.9, so fix new violations and
re-enable gating.

Change-Id: I7a3e9006cfb756da4893b9c0a6139a2e70c9aaf4
2014-07-01 13:37:21 +03:00
Igor Degtiarov a440759d40 Fix F402 violations and re-enable gating
F402 got stricter in hacking 0.9, so fix new violations and
re-enable gating.

Change-Id: I81a1b14311ea6dc7f01353aa27d1f18f1aec8e81
2014-06-25 17:55:59 +03:00
Mehdi Abaakouk 253d99026e Don't keep a single global TRANSPORT object
To keep the global state of messaging like the old olso-incubator
library does, we have created a global TRANSPORT object.

But since the test use the fake:// driver of oslo.messaging in tests,
this transport is shared between tests, but some tests use 'fake://',
other the default one, and someother disable the transport.

This change ensures that a different transport is used for
code tests.

Change-Id: I22317527cc4fb44ea1fb9642586e8cdcbc97030b
2014-06-16 10:31:13 +02:00
Martin Geisler d7054053ae Remove (c) and remove unnecessary encoding lines
The word "Copyright" alone is sufficient to claim copyright, the (c)
symbol need not be present.[1]

As per PEP 263, a Python file with non-ASCII characters must have a
line with "coding: <some-encoding>". Python files containing only
7-bit ASCII characters need no such line.[2]

This commit removes unnecessary Unicode copyright symbols and
unnecessary encoding lines.

[1]: http://www.copyright.gov/circs/circ03.pdf
[2]: http://legacy.python.org/dev/peps/pep-0263/

Closes-Bug: #1324686
Change-Id: Id381ea1f029a0cfddd3773c6d9f16c47842d9c33
2014-05-31 13:02:21 +02:00
Mehdi Abaakouk 6f9e46ba5c oslo.messaging context must be a dict
oslo.messaging assumes the context is a dict not a RequestContext
and it assumes the payload in json serializable.

This patch ensures this.

Also it removes oslo.messaging mock on some tests and use real oslo.messaging
library with the fake driver.

Change-Id: Ie3c6083bbc4ec83de28e42bb10e7c50c7e135070
Closes-bug: #1275771
Closes-bug: #1317290
2014-05-20 17:56:39 +02:00
Mehdi Abaakouk 5995bf906c Replace oslo.rpc by oslo.messaging
The patch replaces oslo.rpc by oslo.messaging.

The important changes:
- On the collector, the queue name and the topic are now the same
  (ie: metering, instead of ceilometer.collector.metering for the queue
  and metering for the topic)
- Same for the alarm partitionner the queue is no more prefixed by
  ceilometer.alarm.

Implements switch-to-oslo.messaging

Change-Id: Ia5e4ff1dd1d419c090b8039627234ae7f07e8660
2014-04-14 11:56:56 +02:00
Ilya Tyaptin f41f8ba75d Fix order of arguments in assertEquals
Part 4

Related to: bug #1277104

Change-Id: I8aea7478afe209096d55ded9966d45a3684248dc
2014-03-14 15:06:03 +04:00
zhang-jinnan feb0b6f18f Remove start index 0 in range()
Remove the useless arg ("start index" = 0) in files, since its default
value is 0, to make code cleaner.

Change-Id: I7cc2127b35df47624f9b4d2045b506e7f56fb7a0
2014-02-13 09:14:15 +08:00
Ilya Tyaptin cdab1401dc Fix work of udp publisher
* Signature is appended also to udp messages
 * All methods for convert from sample to message are moved to publisher/utils.py
 * In configs metering_secret is moved from group publisher_rpc to publisher
 * Changed tests for udp publisher

Fixes: bug #1259171

Change-Id: Ic7727c69d4be6d17ff00f21e323341efd57122a7
2014-01-09 12:53:30 +04:00
Eoghan Glynn e9cde137b0 Avoid false negatives on message signature comparison
Fixes bug 1262255

Previously, samples for the 'instance.scheduled' meter were always
rejected with a false negative on the message signature verification.

The problem occured because certain resource metadata (such as the
block_device_mapping) in the 'scheduler.run_instance.scheduled'
notification are realized as a list of dict, and are thus similarly
encoded in the corresponding sample payload.

However the message signature computation then became indeterminate,
as the unicode representation of equivalent dicts is not guaranteed
equal (e.g. depends on insertion order in the case of hash collisions).

Now, we avoid false negatives by explicitly re-ordering insertion
into such dicts.

Change-Id: I77f7d89229518cf040608d7eb3307e2257bce07a
2014-01-06 14:34:22 +00:00
Julien Danjou 36955618ae Move tests into ceilometer module
Doing this allow for potential importing of the tests and is cleaner
than having a side directory. Nova already does this, so let's move.

Change-Id: I77fc9c5356f3962363fd355b8dbf44fbeec157ee
2013-11-13 15:32:31 +01:00