Doug Hellmann 1b5eb0bad4 Fix the configuration for the nova notifier
The global config object inside the ceilometer copy
of openstack.common.cfg was not being configured,
which meant the RPC code in openstack.common.rpc
was not set up. That lead to an infinite loop
when the notifier was invoked, since it tried
to connect to the message bus over and over and over.
This change forces the configuration object to be
loaded from the ceilometer agent configuration file,
assumed to be in /etc/ceilometer/ceilometer-agent.conf.

It also changes the notifier to do that initialization
the first time it is used, rather than when the module
is imported. This prevents the tests from loading the
module and initializing the config object, causing
exceptions in any subsequent code that tries to add
new configuration options.

Also folded into this changeset is a fix to use
the right db method to load the instance. Notification
messages contain the UUID of the object, not the
numerical key from the id column of the table. Therefore,
we need to use db.instance_get_by_uuid() instead of
db.instance_get().

Change-Id: I45719ab879ae6163329b6a886dee3e82ed4bc260
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-10-07 19:18:32 -04:00
..