From 3ffa010725b58bfb79c4a79ee1a9ab6b0992dbd5 Mon Sep 17 00:00:00 2001 From: Yujian Zhu Date: Mon, 28 Jan 2019 16:31:11 +0800 Subject: [PATCH] Update nettools.py --- src/utils/nettools.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/nettools.py b/src/utils/nettools.py index 3c8525c..9293278 100755 --- a/src/utils/nettools.py +++ b/src/utils/nettools.py @@ -430,7 +430,6 @@ class portcontrol(object): ports_lock.release() try: subprocess.run(['iptables','-t','nat','-A','PREROUTING','-p','tcp','--dport',str(free_port),"-j","DNAT",'--to-destination','%s:%s'%(container_ip,container_port)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False, check=True) - return [True, str(free_port)] except subprocess.CalledProcessError as suberror: return [False, "set port mapping failed : %s" % suberror.stdout.decode('utf-8')] try: