Added support for custom DB Port
This commit is contained in:
parent
13030af3ff
commit
f7c6161027
@ -12,7 +12,7 @@ class DB_Mysql():
|
|||||||
|
|
||||||
required_settings = ['PASSWORD_SALT', 'DB_MYSQL_HOST',
|
required_settings = ['PASSWORD_SALT', 'DB_MYSQL_HOST',
|
||||||
'DB_MYSQL_USER', 'DB_MYSQL_PASS',
|
'DB_MYSQL_USER', 'DB_MYSQL_PASS',
|
||||||
'DB_MYSQL_DBNAME']
|
'DB_MYSQL_DBNAME', 'DB_MYSQL_PORT']
|
||||||
|
|
||||||
for setting_name in required_settings:
|
for setting_name in required_settings:
|
||||||
if not hasattr(settings, setting_name):
|
if not hasattr(settings, setting_name):
|
||||||
@ -26,7 +26,8 @@ class DB_Mysql():
|
|||||||
getattr(settings, 'DB_MYSQL_HOST'),
|
getattr(settings, 'DB_MYSQL_HOST'),
|
||||||
getattr(settings, 'DB_MYSQL_USER'),
|
getattr(settings, 'DB_MYSQL_USER'),
|
||||||
getattr(settings, 'DB_MYSQL_PASS'),
|
getattr(settings, 'DB_MYSQL_PASS'),
|
||||||
getattr(settings, 'DB_MYSQL_DBNAME')
|
getattr(settings, 'DB_MYSQL_DBNAME'),
|
||||||
|
getattr(settings, 'DB_MYSQL_PORT')
|
||||||
)
|
)
|
||||||
self.dbc = self.dbh.cursor()
|
self.dbc = self.dbh.cursor()
|
||||||
self.dbh.autocommit(True)
|
self.dbh.autocommit(True)
|
||||||
@ -347,4 +348,3 @@ class DB_Mysql():
|
|||||||
|
|
||||||
if data[0] <= 0:
|
if data[0] <= 0:
|
||||||
raise Exception("There is no shares table. Have you imported the MPOS schema?")
|
raise Exception("There is no shares table. Have you imported the MPOS schema?")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user