haproxy get_stats method is not python3 compatible

Bug #1698301 reported by Thomas Herve
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
octavia
Fix Released
High
Thomas Herve

Bug Description

As seen in Heat python3 jobs:

Traceback (most recent call last):
  File "/opt/stack/new/neutron-lbaas/neutron_lbaas/agent/agent_manager.py", line 142, in collect_stats
    stats = driver.loadbalancer.get_stats(loadbalancer_id)
  File "/opt/stack/new/neutron-lbaas/neutron_lbaas/drivers/haproxy/namespace_driver.py", line 460, in get_stats
    return self.driver.get_stats(loadbalancer_id)
  File "/opt/stack/new/neutron-lbaas/neutron_lbaas/drivers/haproxy/namespace_driver.py", line 182, in get_stats
    STATS_TYPE_SERVER_REQUEST))
  File "/opt/stack/new/neutron-lbaas/neutron_lbaas/drivers/haproxy/namespace_driver.py", line 258, in _get_stats_from_socket
    s.send('show stat -1 %s -1\n' % entity_type)
  File "/usr/local/lib/python3.5/dist-packages/eventlet/greenio/base.py", line 384, in send
    return self._send_loop(self.fd.send, data, flags)
  File "/usr/local/lib/python3.5/dist-packages/eventlet/greenio/base.py", line 371, in _send_loop
    return send_method(data, *args)
TypeError: a bytes-like object is required, not 'str'

Tags: lbaas
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lbaas (master)

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

Changed in octavia:
assignee: nobody → Thomas Herve (therve)
status: New → In Progress
tags: added: lbaas
Changed in octavia:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lbaas (master)

Reviewed: https://review.openstack.org/474868
Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=c5a8ed2447ca16729f13b2c9902baa1ac4916280
Submitter: Jenkins
Branch: master

commit c5a8ed2447ca16729f13b2c9902baa1ac4916280
Author: Thomas Herve <email address hidden>
Date: Fri Jun 16 08:59:59 2017 +0200

    Send haproxy stat command as bytes

    The get_stats method on the haproxy driver fails with a byte error,
    let's encode the command before sending it, and decode the result.

    Change-Id: I3ea1ca4ca3216e9411ac761f54f458eea5d736fb
    Closes-Bug: #1698301

Changed in octavia:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-lbaas 11.0.0.0rc1

This issue was fixed in the openstack/neutron-lbaas 11.0.0.0rc1 release candidate.

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.