LBaaS plugin returns unnecessary information for PING and TCP health monitors

Bug #1100749 reported by Roman Prykhodchenko
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Avishay Balderman

Bug Description

The plugin returns url_path, http_method and expected_codes for PING health monitors. In fact this properties should not be returned for TCP and PING monitors because that might be confusing.

{
     "health_monitor": {
          "status": "PENDING_CREATE",
          "admin_state_up": true,
          "tenant_id": "admin",
          "delay": 60,
          "expected_codes": "200",
          "max_retries": 2,
          "http_method": "GET",
          "timeout": 10,
          "url_path": "/images",
          "type": "PING",
          "id": "aaa8adeb-5c1a-40c5-92d5-1cf962a5c22a"
    }
}

Tags: lbaas
summary: - LBaaS plugin returns unnecessary information for PING health monitors
+ LBaaS plugin returns unnecessary information for PING and TCP health
+ monitors
Revision history for this message
Avishay Balderman (avishayb) wrote :

-- Fix proposal --
Code : quantum/db/loadbalancer/loadbalancer_db.py

Current code:
----------------
 def _make_health_monitor_dict(self, health_monitor, fields=None):
        res = {'id': health_monitor['id'],
               'tenant_id': health_monitor['tenant_id'],
               'type': health_monitor['type'],
               'delay': health_monitor['delay'],
               'timeout': health_monitor['timeout'],
               'max_retries': health_monitor['max_retries'],
               'http_method': health_monitor['http_method'],
               'url_path': health_monitor['url_path'],
               'expected_codes': health_monitor['expected_codes'],
               'admin_state_up': health_monitor['admin_state_up'],
               'status': health_monitor['status']}
        return self._fields(res, fields)

Proposed code:
-------------------
 def _make_health_monitor_dict(self, health_monitor, fields=None):
        res = {'id': health_monitor['id'],
               'tenant_id': health_monitor['tenant_id'],
               'type': health_monitor['type'],
               'delay': health_monitor['delay'],
               'timeout': health_monitor['timeout'],
               'max_retries': health_monitor['max_retries'],
               'expected_codes': health_monitor['expected_codes'],
               'admin_state_up': health_monitor['admin_state_up'],
               'status': health_monitor['status']}
        if res["type"] not in ["TCP","PING"]:
              res['url_path'] health_monitor['url_path']
              res['http_method'] health_monitor['http_method']
        return self._fields(res, fields)

Revision history for this message
Avishay Balderman (avishayb) wrote :

'expected_codes'' should be included under the condition

Changed in quantum:
assignee: nobody → Avishay Balderman (avishayb)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/20306

Changed in quantum:
status: New → In Progress
Changed in quantum:
importance: Undecided → Medium
milestone: none → grizzly-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/20306
Committed: http://github.com/openstack/quantum/commit/6f6499700a8ce682f9d0963180cbc389ac4acc85
Submitter: Jenkins
Branch: master

commit 6f6499700a8ce682f9d0963180cbc389ac4acc85
Author: Avishay Balderman <email address hidden>
Date: Wed Jan 23 01:49:32 2013 -0800

    LBaaS plugin returns unnecessary information for PING and TCP health monitors

    Fixes Bug #1100749

    Change-Id: Id1e22621b398786f3d6b670f53b6e23e7fb89786

Changed in quantum:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in quantum:
milestone: grizzly-3 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.