Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
when conf check failed, run_haproxy should return the old pid instead…
Browse files Browse the repository at this point in the history
… of empty string
  • Loading branch information
tifayuki committed Jun 14, 2017
1 parent 828e049 commit 9eb0dbd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions haproxy/helper/update_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@
#
def run_reload(old_process, timeout=int(RELOAD_TIMEOUT)):
if old_process:
# Config check
p = subprocess.Popen(HAPROXY_CONFIG_CHECK_COMMAND, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
output, err = p.communicate()
return_code = p.returncode
if (return_code != 0):
logger.error("Config check failed. NOT reloading haproxy")
logger.error(output)
logger.error(err)
return
if p.returncode != 0:
logger.error("Config check failed. NOT reloading haproxy: %s - %s" % (err, output))
return old_process
else:
logger.info("Config check passed")
# Reload haproxy

# Reload Haproxy
logger.info("Reloading HAProxy")
if timeout == -1:
flag = "-st"
Expand Down

0 comments on commit 9eb0dbd

Please sign in to comment.