From e8e47b5533d8cea7c5e531d1630f63a2e70c6d47 Mon Sep 17 00:00:00 2001 From: sepandhaghighi Date: Wed, 30 Dec 2020 19:42:45 +0330 Subject: [PATCH] fix : minor edit in network_control function #35 --- orangetool/orangetool_ip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/orangetool/orangetool_ip.py b/orangetool/orangetool_ip.py index b5662c9..2f82f31 100644 --- a/orangetool/orangetool_ip.py +++ b/orangetool/orangetool_ip.py @@ -198,8 +198,9 @@ def network_control(command, device="eth0", debug=False): cmd = "up" if command == "down": cmd = "down" - output = sub.Popen(["ifconfig", device, cmd], + cmd_out = sub.Popen(["ifconfig", device, cmd], stderr=sub.PIPE, stdin=sub.PIPE, stdout=sub.PIPE) + output = list(cmd_out.communicate()) if len(output[0]) == 0 and len(output[1]) == 0: return True return False