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

Commit 12bb35a

Browse files
committed
reformat the code
1 parent 1a77f7c commit 12bb35a

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

haproxy/helper/update_helper.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import errno
12
import logging
23
import subprocess
34
import threading
45
import time
5-
import errno
66

77
from haproxy.config import HAPROXY_RUN_COMMAND, RELOAD_TIMEOUT, HAPROXY_CONFIG_CHECK_COMMAND
88

@@ -22,16 +22,17 @@
2222
#
2323
def run_reload(old_process, timeout=int(RELOAD_TIMEOUT)):
2424
if old_process:
25-
p = subprocess.Popen(HAPROXY_CONFIG_CHECK_COMMAND, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
25+
p = subprocess.Popen(HAPROXY_CONFIG_CHECK_COMMAND, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
26+
stderr=subprocess.PIPE)
2627
output, err = p.communicate()
2728
return_code = p.returncode
2829
if (return_code != 0):
29-
logger.error("Config check failed. NOT reloading haproxy")
30-
logger.error(output)
31-
logger.error(err)
32-
return
30+
logger.error("Config check failed. NOT reloading haproxy")
31+
logger.error(output)
32+
logger.error(err)
33+
return
3334
else:
34-
logger.info("Config check passed")
35+
logger.info("Config check passed")
3536
# Reload haproxy
3637
logger.info("Reloading HAProxy")
3738
if timeout == -1:

tests/unit/helper/test_update_helper.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ def poll(self):
2424

2525
def terminate(self):
2626
self.terminated = True
27-
27+
2828
def communicate(self):
2929
return ("", "")
3030

3131
pass
3232

3333
class Object(object):
34-
returncode = 0
35-
36-
def communicate(self):
37-
return ("", "")
38-
39-
pass
34+
returncode = 0
35+
36+
def communicate(self):
37+
return ("", "")
38+
39+
pass
4040

4141
@mock.patch("haproxy.helper.update_helper.subprocess.Popen")
4242
def test_run_graceful_reload_within_timeout(self, mock_popen):

0 commit comments

Comments
 (0)