add getKeys in switchrule.py
This commit is contained in:
parent
a142b957a7
commit
298e8a06c9
2 changed files with 8 additions and 1 deletions
|
@ -76,7 +76,11 @@ class DbTransfer(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def pull_db_all_user():
|
def pull_db_all_user():
|
||||||
#数据库所有用户信息
|
#数据库所有用户信息
|
||||||
keys = ['port', 'u', 'd', 'transfer_enable', 'passwd', 'enable' ]
|
try:
|
||||||
|
import switchrule
|
||||||
|
keys = switchrule.getKeys()
|
||||||
|
except Exception, e:
|
||||||
|
keys = ['port', 'u', 'd', 'transfer_enable', 'passwd', 'enable' ]
|
||||||
conn = cymysql.connect(host=Config.MYSQL_HOST, port=Config.MYSQL_PORT, user=Config.MYSQL_USER,
|
conn = cymysql.connect(host=Config.MYSQL_HOST, port=Config.MYSQL_PORT, user=Config.MYSQL_USER,
|
||||||
passwd=Config.MYSQL_PASS, db=Config.MYSQL_DB, charset='utf8')
|
passwd=Config.MYSQL_PASS, db=Config.MYSQL_DB, charset='utf8')
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
def getKeys():
|
||||||
|
return ['port', 'u', 'd', 'transfer_enable', 'passwd', 'enable' ]
|
||||||
|
|
||||||
def isTurnOn(row):
|
def isTurnOn(row):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue