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

Commit 9eb0dbd

Browse files
committed
when conf check failed, run_haproxy should return the old pid instead of empty string
1 parent 828e049 commit 9eb0dbd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

haproxy/helper/update_helper.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@
2222
#
2323
def run_reload(old_process, timeout=int(RELOAD_TIMEOUT)):
2424
if old_process:
25+
# Config check
2526
p = subprocess.Popen(HAPROXY_CONFIG_CHECK_COMMAND, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
2627
stderr=subprocess.PIPE)
2728
output, err = p.communicate()
28-
return_code = p.returncode
29-
if (return_code != 0):
30-
logger.error("Config check failed. NOT reloading haproxy")
31-
logger.error(output)
32-
logger.error(err)
33-
return
29+
if p.returncode != 0:
30+
logger.error("Config check failed. NOT reloading haproxy: %s - %s" % (err, output))
31+
return old_process
3432
else:
3533
logger.info("Config check passed")
36-
# Reload haproxy
34+
35+
# Reload Haproxy
3736
logger.info("Reloading HAProxy")
3837
if timeout == -1:
3938
flag = "-st"

0 commit comments

Comments
 (0)