config-changed always closes and then reopens all the ports

Bug #1962584 reported by Junien Fridrick
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
charm-haproxy
Fix Released
Undecided
Unassigned

Bug Description

Hi,

update_service_ports() is called with a list of strings for old ports, and a tuple of ints for new ports - leading to all ports getting closed then opened.

The bug is here :

    old_service_ports = []
    for port_plus_proto in opened_ports():
        # opened_ports returns e.g. ['22/tcp', '53/udp']
        # but we just want the port numbers, as ints
        if port_plus_proto.endswith('/tcp') or port_plus_proto.endswith('/udp'):
            port_only = port_plus_proto[:-4]
            old_service_ports.append(port_only)
        else:
            raise ValueError('{} is not a valid port/proto value'.format(port_plus_proto))

We need to append "int(port_only)" to get ints.

Revision history for this message
Haw Loeung (hloeung) wrote :
Revision history for this message
Junien Fridrick (axino) wrote :
Changed in charm-haproxy:
status: New → Invalid
status: Invalid → Fix Released
Revision history for this message
Haw Loeung (hloeung) wrote :

See also LP:1962755 where change in recent versions of Juju causing issues re-opening.

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.