refactor meter event publishing code

There were two places that had all of the logic for constructing
a metering message and sending it to the appropriate exchanges.
This changeset combines those into one function and invokes
the function from the old locations.

Update tox.ini to work around an issue with providing access to
the global site-packages (https://bitbucket.org/hpk42/tox/issue/32).

Change-Id: If2b01edbc0c372907a04baf69f1137575b6921bd
Sketch out a plugin system for saving metering data.

Change-Id: Ib91213ac78fd5e3baf7200849b4fa8554c652a99
check message signatures in the collector

bug 1006990

add verify_signature function
check the signature before calling the storage engine to save the data
add coverage to py27 environment by default
fix use of mox in existing test

Change-Id: I6666ea117fb66526ee187b168eca88e4b0092a23
Copy openstack.common.cfg

This fixes bug #1009586

Change-Id: If188709510ac98413e8c568d5a9e8c5f758c8497
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
Remove nova.flags usage

There's no need to use nova.flags here, we can use our cfg module.

Change-Id: Ia6ecbf48a89a07b702d2955f89851b5c188a62fd
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
fix message signatures for nested dicts

The order of iteration for dictionary keys is not
guaranteed, so we need to address nested dictionaries
directly.

Change-Id: Iebfaa11d9edea3749ce7b86b5f723f955c535057
Remove event_type field from meter messages

The event_type field is made up of the meter exchange name
and the counter name. That information is available elsewhere,
so the field is redundant.

bug 1006995

Change-Id: I37ed14e469bc146017ecceedd6539d61eb7823e1
log more than ceilometer

The default logging configuration does not include output
from packages other than 'ceilometer'. Since we depend
on nova services, we want to have those messages logged,
too.

Change-Id: I4f67b61d3990a0667ee91e32c77ab909f600d451
Merge "Remove event_type field from meter messages"
Merge "log more than ceilometer"
Merge "fix message signatures for nested dicts"
Add Essex tests

Change-Id: I098888c9d011819a6bca4df532534a39da67e9eb
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
Register storage options on import

We already does this for other module, so continue.

Change-Id: I1e38fd0eddd41b9e4e239c0b5fbbaf31ebf4d599
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
Add more metadata to instance counter

This fixes #1006120

Change-Id: Iba774d6ffbcceb7c35da48c103c7907af175e64e
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
Combined fix to get past broken state of repo

This patch includes several separate sets of changes which
have been reviewed individually but must be submitted
together to get past the newly updated version of pep8
and changes to the nova code base.

1. Replace our CONF object with the one from openstack.common.cfg.
   There's no need to use our own, especially since some option
   are already registered on it for us.

   Signed-off-by: Julien Danjou <julien.danjou@enovance.com>

2. Instead of importing the RPC code from nova, use
   the openstack.common.rpc package. This change
   copies that code in from openstack-common, changes
   the imports throughout ceilometer, and fixes the
   way the configuration settings are initialized.

3. Resolve PEP-8 issues introduced by an even more
   pedantic version of pep8 (1.3.1). Some of the
   changes are fixed, and some warnings/errors are
   suppressed.

4. Ignore import errors in impl_qpid because the qpid
   package is not installed on the stackforge test server.

5. Fix missing imports from gettextutils in openstack.common.

Change-Id: I0ee7d4b3278d8ff1951ca27592e3be8a87fe4854
Add instance metadata from notification events

bug 1006120

This change depends on a change to nova to include the extra data
in the outgoing notifications.

Change-Id: Ieaee00f5f6c0a9f6d00843adbcc2cd995334bbd1
Start defining DB engine API

Sketch in API to support queries defined in
http://wiki.openstack.org/EfficientMetering/APIProposalv1

Change-Id: I282f1d5893c55fca684a74395a82e603c799343f