diff --git a/vmware_nsx/plugins/common/plugin.py b/vmware_nsx/plugins/common/plugin.py index 83cd85533b..3c59741df1 100644 --- a/vmware_nsx/plugins/common/plugin.py +++ b/vmware_nsx/plugins/common/plugin.py @@ -441,6 +441,14 @@ class NsxPluginBase(db_base_plugin_v2.NeutronDbPluginV2, sg_rule[sg_prefix.LOCAL_IP_PREFIX].startswith('::/'))): 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", + {'len': len(ports), + 'plural': 's' if len(ports) > 1 else '', + 'filters': ('filters ' + str(filters) if filters + else 'no filters')}) + def get_housekeeper(self, context, name, fields=None): # run the job in readonly mode and get the results self.housekeeper.run(context, name, readonly=True) diff --git a/vmware_nsx/plugins/dvs/plugin.py b/vmware_nsx/plugins/dvs/plugin.py index 7f598d46f2..7457b2c2bc 100644 --- a/vmware_nsx/plugins/dvs/plugin.py +++ b/vmware_nsx/plugins/dvs/plugin.py @@ -603,6 +603,7 @@ class NsxDvsV2(addr_pair_db.AllowedAddressPairsMixin, super(NsxDvsV2, self).get_ports( context, filters, fields, sorts, limit, marker, page_reverse)) + self._log_get_ports(ports, filters) # Add port extensions for port in ports: self.plugin_extend_port_dict_binding(context, port) diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index c3f5c2a5e2..70cb60b6f4 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -1477,6 +1477,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): super(NsxPolicyPlugin, self).get_ports( context, filters, fields, sorts, limit, marker, page_reverse)) + self._log_get_ports(ports, filters) # Add port extensions for port in ports[:]: self._extend_nsx_port_dict_binding(context, port) diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index 15fcd542d0..8392d71029 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -2721,6 +2721,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, super(NsxVPluginV2, self).get_ports( context, filters, fields, sorts, limit, marker, page_reverse)) + self._log_get_ports(ports, filters) # Add the relevant port extensions for port in ports[:]: self._extend_get_port_dict_qos_and_binding(context, port) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index ca9d7c39e9..5ea33a999d 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -2055,6 +2055,7 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base, super(NsxV3Plugin, self).get_ports( context, filters, fields, sorts, limit, marker, page_reverse)) + self._log_get_ports(ports, filters) # Add port extensions for port in ports[:]: self._extend_get_port_dict_qos_and_binding(context, port)