Scheduler: enhance debug messages for multitenancy aggregates

Debugging issues with the multitenacy aggregate filter is difficult
as one does not know if the filter_tenant_id is matched or not.

This patch added in a log debug that indicates the reason for the
filter being valid.

Change-Id: I17a3186057071e16f3933f7872fd34186306ef74
This commit is contained in:
Gary Kotton
2015-04-29 05:34:43 -07:00
committed by garyk
parent 183cd88cb2
commit d0df97e4e9

View File

@@ -44,7 +44,12 @@ class AggregateMultiTenancyIsolation(filters.BaseHostFilter):
key="filter_tenant_id")
if metadata != {}:
if tenant_id not in metadata["filter_tenant_id"]:
LOG.debug("%s fails tenant id on aggregate", host_state)
return False
configured_tenant_ids = metadata.get("filter_tenant_id")
if configured_tenant_ids:
if tenant_id not in configured_tenant_ids:
LOG.debug("%s fails tenant id on aggregate", host_state)
return False
LOG.debug("Host tenant id %s matched", tenant_id)
else:
LOG.debug("No tenant id's defined on host. Host passes.")
return True