From 5e485eb2bec7c9ace311d1292011aae1b5478218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Sun, 21 Aug 2016 23:07:33 +0800 Subject: [PATCH] warn if incorrect node id --- db_transfer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db_transfer.py b/db_transfer.py index b85c66e..1e726ce 100644 --- a/db_transfer.py +++ b/db_transfer.py @@ -311,7 +311,7 @@ class DbTransfer(TransferBase): rows = self.pull_db_users(conn) conn.close() - if len(rows) == 0: + if not rows: logging.warn('no user in db') return rows @@ -439,6 +439,7 @@ class Dbv3Transfer(DbTransfer): rows = [] cur.close() conn.commit() + logging.warn('None result when select node info from ss_node in db, maybe you set the incorrect node id') return rows cur.close() @@ -519,7 +520,7 @@ class MuJsonTransfer(TransferBase): except Exception as e: logging.error(e) - if len(rows) == 0: + if not rows: logging.warn('no user in json file') return rows