mirror of https://github.com/cowrie/cowrie.git
Add support for specifying MySQL port (issue #61)
git-svn-id: https://kippo.googlecode.com/svn/trunk@225 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
parent
3a7bcc0ff5
commit
41363db9d4
|
@ -130,6 +130,7 @@ interact_port = 5123
|
|||
#database = kippo
|
||||
#username = kippo
|
||||
#password = secret
|
||||
#port = 3306
|
||||
|
||||
# XMPP Logging
|
||||
#
|
||||
|
|
|
@ -32,11 +32,16 @@ class ReconnectingConnectionPool(adbapi.ConnectionPool):
|
|||
|
||||
class DBLogger(dblog.DBLogger):
|
||||
def start(self, cfg):
|
||||
if cfg.has_option('database_mysql', 'port'):
|
||||
port = int(cfg.get('database_mysql', 'port'))
|
||||
else:
|
||||
port = 3306
|
||||
self.db = ReconnectingConnectionPool('MySQLdb',
|
||||
host = cfg.get('database_mysql', 'host'),
|
||||
db = cfg.get('database_mysql', 'database'),
|
||||
user = cfg.get('database_mysql', 'username'),
|
||||
passwd = cfg.get('database_mysql', 'password'),
|
||||
port = port,
|
||||
cp_min = 1,
|
||||
cp_max = 1)
|
||||
|
||||
|
|
Loading…
Reference in New Issue