From 8a170a0cf813e19d4eb9fb01b13c8a296e8bd6c8 Mon Sep 17 00:00:00 2001 From: asarfaty Date: Sun, 9 Aug 2020 11:00:05 +0200 Subject: [PATCH] Reduce number of logs Do not print get-ports log if the result has only 1 port Change-Id: Iab428b2461738aa918411455bf620cb88de53da6 --- vmware_nsx/plugins/common/plugin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vmware_nsx/plugins/common/plugin.py b/vmware_nsx/plugins/common/plugin.py index cbb3c085ee..88b3cc7a58 100644 --- a/vmware_nsx/plugins/common/plugin.py +++ b/vmware_nsx/plugins/common/plugin.py @@ -452,10 +452,9 @@ class NsxPluginBase(db_base_plugin_v2.NeutronDbPluginV2, sg_rule[sg_prefix.LOCAL_IP_PREFIX] = None def _log_get_ports(self, ports, filters): - if len(ports) > 0: - LOG.debug("Getting %(num)s port%(plural)s with %(filters)s", + if len(ports) > 1: + LOG.debug("Getting %(num)s ports with %(filters)s", {'num': len(ports), - 'plural': 's' if len(ports) > 1 else '', 'filters': ('filters ' + str(filters) if filters else 'no filters')})