From d0df97e4e9178a22d4f5b2683439897f6b9d6cc9 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Wed, 29 Apr 2015 05:34:43 -0700 Subject: [PATCH] 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 --- .../filters/aggregate_multitenancy_isolation.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nova/scheduler/filters/aggregate_multitenancy_isolation.py b/nova/scheduler/filters/aggregate_multitenancy_isolation.py index f2fae6e8c354..385a17acf1fa 100644 --- a/nova/scheduler/filters/aggregate_multitenancy_isolation.py +++ b/nova/scheduler/filters/aggregate_multitenancy_isolation.py @@ -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