Merge pull request #389 from GallenShao/master

fix a bug in port mapping
This commit is contained in:
GallenShao 2019-05-24 19:48:52 +08:00 committed by GitHub
commit 8757ab6391
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 7 deletions

View File

@ -380,14 +380,13 @@ class VclusterMgr(object):
[success,msg] = worker.release_port_mapping(node_name, node_ip, str(node_port)) [success,msg] = worker.release_port_mapping(node_name, node_ip, str(node_port))
else: else:
[success,msg] = portcontrol.release_port_mapping(node_name, node_ip, str(node_port)) [success,msg] = portcontrol.release_port_mapping(node_name, node_ip, str(node_port))
if not success:
return [False,msg]
db.session.delete(item) db.session.delete(item)
break
else:
return [False,"No port mapping."]
db.session.commit() db.session.commit()
if success:
return [True, json.loads(str(vcluster))] return [True, json.loads(str(vcluster))]
else:
return [False, msg]
return [False, "No port mapping."]
def flush_cluster(self,username,clustername,containername): def flush_cluster(self,username,clustername,containername):
begintime = datetime.datetime.now() begintime = datetime.datetime.now()