From 5d1a97394d667e9741cc617d43b29367d0a84359 Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Tue, 13 Nov 2018 16:49:09 -0600 Subject: [PATCH] Don't emit a notification for the root domain This change stops keystone from emitting a notification when the resource is the root domain <>. Currently nothing should be invoking the root domain as an initiator outside of tests, once the root domain is properly exposed this can be removed. Change-Id: Ic8bfd57a7e6e44342cf3748a6be3824de5aed1a0 --- keystone/notifications.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/keystone/notifications.py b/keystone/notifications.py index cdcd8a2365..b677d60ec5 100644 --- a/keystone/notifications.py +++ b/keystone/notifications.py @@ -74,6 +74,7 @@ _SUBSCRIBERS = {} _notifier = None SERVICE = 'identity' +ROOT_DOMAIN = '<>' CONF = keystone.conf.CONF @@ -420,6 +421,13 @@ def _create_cadf_payload(operation, resource_type, resource_id, target_uri = taxonomy.UNKNOWN else: target_uri = CADF_TYPE_MAP.get(resource_type) + + # TODO(gagehugo): The root domain ID is typically hidden, there isn't a + # reason to emit a notification for it. Once we expose the root domain + # (and handle the CADF UUID), remove this. + if resource_id == ROOT_DOMAIN: + return + target = resource.Resource(typeURI=target_uri, id=resource_id)