]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Wrong key router.interface reported by ceilometer
authorLi Ma <skywalker.nick@gmail.com>
Fri, 25 Apr 2014 07:24:57 +0000 (00:24 -0700)
committerLi Ma <skywalker.nick@gmail.com>
Sat, 26 Apr 2014 11:23:16 +0000 (04:23 -0700)
Ceilometer with MongoDB doesn't accept the key with dot.

The dot in 'router.interface' should be replaced with '_',
which is also the standard implementation of other keys in neutron.

Change-Id: If7fcf7658db9ee2d7d1248bb0b016b4389c32c77
Closes-Bug: #1310460

neutron/db/l3_db.py
neutron/tests/unit/test_l3_plugin.py

index a1d4c6d13db7d2221f22f3cdd0132acd166137a3..beebaee878f664ed2fb7ec272ba1a1d91b593758 100644 (file)
@@ -446,7 +446,7 @@ class L3_NAT_db_mixin(l3.RouterPluginBase):
                             notifier_api.publisher_id('network'),
                             'router.interface.create',
                             notifier_api.CONF.default_notification_level,
-                            {'router.interface': info})
+                            {'router_interface': info})
         return info
 
     def _confirm_router_interface_not_in_use(self, context, router_id,
@@ -520,7 +520,7 @@ class L3_NAT_db_mixin(l3.RouterPluginBase):
                             notifier_api.publisher_id('network'),
                             'router.interface.delete',
                             notifier_api.CONF.default_notification_level,
-                            {'router.interface': info})
+                            {'router_interface': info})
         return info
 
     def _get_floatingip(self, context, id):
index 25be9cddcadb4771632541eee367a77d871c4423..23ea42d50a4d05e4eb9028e21ee441017f6a5074 100644 (file)
@@ -670,7 +670,7 @@ class L3NatTestCaseBase(L3NatTestCaseMixin):
 
                 for n in test_notifier.NOTIFICATIONS:
                     if n['event_type'].startswith('router.interface.'):
-                        payload = n['payload']['router.interface']
+                        payload = n['payload']['router_interface']
                         self.assertIn('id', payload)
                         self.assertEqual(payload['id'], r['router']['id'])
                         self.assertIn('tenant_id', payload)