unixsurfer / haproxytool

A tool to interact with HAProxy via stats socket
Apache License 2.0
85 stars 8 forks source link

Update port for server not working #7

Closed Nintengao closed 4 years ago

Nintengao commented 4 years ago

I am trying to use the set port command for a server according to instruction. This is the command I am using: haproxytool server -D /var/lib/haproxy --port 8888 srv1 As a result, I am able to see this after the command: set port for sv1 server to 8888 in bck1 backend However, the new port is not actually reflected in haproxy as it still shows the old port using the --show-port option, or directly from the stat sock.

Updating the port of a server directly through stat sock seems fine.

The version of Haproxy: HA-Proxy version 1.9.15 2020/04/02 - https://haproxy.org/

Nintengao commented 4 years ago

After some investigation, the problem seems to be that I am using python2, and the way the setter of server port is defined is only going to work in python3.