diff --git a/keystone/catalog/core.py b/keystone/catalog/core.py index fc24deb121..0ffc1afc3a 100644 --- a/keystone/catalog/core.py +++ b/keystone/catalog/core.py @@ -26,6 +26,7 @@ from keystone.common import manager from keystone import config from keystone import exception from keystone.i18n import _ +from keystone import notifications from keystone.openstack.common import log @@ -70,6 +71,7 @@ class Manager(manager.Manager): dynamically calls the backend. """ + _ENDPOINT = 'endpoint' def __init__(self): super(Manager, self).__init__(CONF.catalog.driver) @@ -145,6 +147,7 @@ class Manager(manager.Manager): service_id = endpoint_ref.get('service_id') raise exception.ServiceNotFound(service_id=service_id) + @notifications.deleted(_ENDPOINT, public=False) def delete_endpoint(self, endpoint_id): try: ret = self.driver.delete_endpoint(endpoint_id) diff --git a/keystone/tests/test_notifications.py b/keystone/tests/test_notifications.py index 6a0d9bb127..d93e9f5625 100644 --- a/keystone/tests/test_notifications.py +++ b/keystone/tests/test_notifications.py @@ -308,6 +308,13 @@ class NotificationsForEntities(test_v3.RestfulTestCase): self.assignment_api.delete_domain(domain_ref['id']) self._assertLastNotify(domain_ref['id'], DELETED_OPERATION, 'domain') + def test_delete_endpoint(self): + endpoint_ref = self.new_endpoint_ref(service_id=self.service_id) + self.catalog_api.create_endpoint(endpoint_ref['id'], endpoint_ref) + self.catalog_api.delete_endpoint(endpoint_ref['id']) + self._assertNotifySent(endpoint_ref['id'], DELETED_OPERATION, + 'endpoint', public=False) + def test_disable_domain(self): domain_ref = self.new_domain_ref() self.assignment_api.create_domain(domain_ref['id'], domain_ref)