Log resource id in the callbacks publish method

It may help in debugging if we will know for what resource exactly
callbacks are published.

Related-Bug: #1953478
Change-Id: Ia741d4d87d3a284add2f2c48f780d5332540fafe
This commit is contained in:
Slawek Kaplonski 2021-12-23 11:55:40 +01:00
parent cb031937ed
commit 76b9a09591

View File

@ -172,8 +172,9 @@ class CallbacksManager(object):
callbacks = list(itertools.chain(
*[pri_callbacks.items() for (priority, pri_callbacks)
in self._callbacks[resource].get(event, [])]))
LOG.debug("Publish callbacks %s for %s, %s",
[c[0] for c in callbacks], resource, event)
resource_id = getattr(payload, "resource_id", None)
LOG.debug("Publish callbacks %s for %s (%s), %s",
[c[0] for c in callbacks], resource, resource_id, event)
# TODO(armax): consider using a GreenPile
for callback_id, callback in callbacks:
try: