From f140be8b7728078f9b409b67ff58d87bb7943ca7 Mon Sep 17 00:00:00 2001 From: Rudra Rugge Date: Tue, 21 Apr 2015 16:42:50 -0700 Subject: [PATCH] Return health monitor values based on type Neutron CLI queries for health monitor show returns all the HTTP/HTTPS specific default values even if the type is PING or TCP. Return values based on the type of the healthmonitor Change-Id: I7e7ccc65d26130b79cccbc16f180c0c298195dda Partial-Bug: #1374116 --- .../opencontrail/loadbalancer/loadbalancer_healthmonitor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/loadbalancer_healthmonitor.py b/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/loadbalancer_healthmonitor.py index f3a18d2..57a693f 100644 --- a/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/loadbalancer_healthmonitor.py +++ b/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/loadbalancer_healthmonitor.py @@ -42,9 +42,13 @@ def make_dict(self, health_monitor, fields=None): 'status': self._get_object_status(health_monitor)} props = health_monitor.get_loadbalancer_healthmonitor_properties() + monitor_type = getattr(props, 'monitor_type') for key, mapping in self._loadbalancer_health_type_mapping.iteritems(): value = getattr(props, key) if value is not None: + if monitor_type not in ('HTTP', 'HTTPS'): + if mapping in ('http_method', 'url_path', 'expected_codes'): + continue res[mapping] = value pool_ids = []