From f830ab87edd231899fba9c549fef99c6075d1108 Mon Sep 17 00:00:00 2001 From: Gallen Date: Fri, 24 May 2019 19:47:58 +0800 Subject: [PATCH] fix a bug in port mapping --- src/master/vclustermgr.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/master/vclustermgr.py b/src/master/vclustermgr.py index 26f5980..f0e8046 100755 --- a/src/master/vclustermgr.py +++ b/src/master/vclustermgr.py @@ -380,14 +380,13 @@ class VclusterMgr(object): [success,msg] = worker.release_port_mapping(node_name, node_ip, str(node_port)) else: [success,msg] = portcontrol.release_port_mapping(node_name, node_ip, str(node_port)) - if not success: - return [False,msg] db.session.delete(item) - break - else: - return [False,"No port mapping."] - db.session.commit() - return [True, json.loads(str(vcluster))] + db.session.commit() + if success: + return [True, json.loads(str(vcluster))] + else: + return [False, msg] + return [False, "No port mapping."] def flush_cluster(self,username,clustername,containername): begintime = datetime.datetime.now()