diff options
author | Julien Danjou <julien@danjou.info> | 2013-07-24 17:23:11 +0200 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2013-08-07 10:55:27 +0200 |
commit | e49c949f394c20321d0fe01c060ec3b4e19d94e6 (patch) | |
tree | 5d84fe19d2905c390454ce4d2ddbba9aa714ee0a /ceilometer/image | |
parent | d7fb018905002690e476c799844d9a77a6406376 (diff) | |
download | ceilometer-e49c949f394c20321d0fe01c060ec3b4e19d94e6.tar.gz |
Handle more Nova and Neutron events
This introduces a simpler matching system for event types that supports
wildcard. We use this to grab all Nova instances notifications and a bit
more Neutron events.
We also change the get_event_types to a property to simplify the code a
bit.
Change-Id: Ica133ff2e9348a5d2640f068251d034bbd8a4f43
Diffstat (limited to 'ceilometer/image')
-rw-r--r-- | ceilometer/image/notifications.py | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/ceilometer/image/notifications.py b/ceilometer/image/notifications.py index 35bd755c..f43eb086 100644 --- a/ceilometer/image/notifications.py +++ b/ceilometer/image/notifications.py @@ -51,13 +51,11 @@ class ImageBase(plugin.NotificationBase): class ImageCRUDBase(ImageBase): - @staticmethod - def get_event_types(): - return [ - 'image.update', - 'image.upload', - 'image.delete', - ] + event_types = [ + 'image.update', + 'image.upload', + 'image.delete', + ] class ImageCRUD(ImageCRUDBase): @@ -101,11 +99,7 @@ class ImageSize(ImageCRUDBase): class ImageDownload(ImageBase): """Emit image_download counter when an image is downloaded.""" - @staticmethod - def get_event_types(): - return [ - 'image.send', - ] + event_types = ['image.send'] def process_notification(self, message): yield sample.Sample.from_notification( @@ -121,11 +115,7 @@ class ImageDownload(ImageBase): class ImageServe(ImageBase): """Emit image_serve counter when an image is served out.""" - @staticmethod - def get_event_types(): - return [ - 'image.send', - ] + event_types = ['image.send'] def process_notification(self, message): yield sample.Sample.from_notification( |