Don't send a value in delete pubsub event

Current code sent deleted object ID both in key and value fields of the
update. Since both are always equal, no reason to send this info twice.

Change-Id: I3616a42e9daca3f91ec4ed7ade466e7737c90570
This commit is contained in:
Dima Kuznetsov 2017-08-08 15:19:41 +03:00
parent 0aa3b2e89c
commit 1e6d56030a
2 changed files with 2 additions and 2 deletions

View File

@ -251,7 +251,7 @@ class NbApi(object):
if not skip_send_event:
self._send_db_change_event(model.table_name, obj.id, 'delete',
obj.id, topic)
None, topic)
def get(self, lean_obj):
"""Retrieve a model instance from the database. This function uses

View File

@ -121,7 +121,7 @@ class TestNbApi(tests_base.BaseTestCase):
self.assertEqual('id1', update.key)
self.assertEqual('delete', update.action)
self.assertEqual('topic', update.topic)
self.assertEqual('id1', update.value)
self.assertIsNone(update.value)
self.api_nb.driver.delete_key.assert_called_once_with(
'dummy_table', 'id1', 'topic')