From 79260ff4ab63d851a434971b4f0ce614cd71b299 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Wed, 21 Oct 2015 14:53:14 +0800 Subject: [PATCH] check duplicate port --- db_transfer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/db_transfer.py b/db_transfer.py index 61a7255..e96819a 100644 --- a/db_transfer.py +++ b/db_transfer.py @@ -116,7 +116,12 @@ class DbTransfer(object): port = row['port'] passwd = row['passwd'] - cur_servers[port] = passwd + + if port not in cur_servers: + cur_servers[port] = passwd + else: + logging.error('more than one user use the same port [%s]' % (port,)) + continue if ServerPool.get_instance().server_is_run(port) > 0: if not allow: