If SQLAlchemy is available and it has problems while connecting then it should be smarter to not force the other (standard) method - if available

This commit is contained in:
Miroslav Stampar 2013-04-15 18:42:26 +02:00
parent de99717b00
commit 840ee26a14
2 changed files with 2 additions and 6 deletions

View File

@ -83,11 +83,7 @@ def setHandler():
dialect = DBMS_DICT[name][3] dialect = DBMS_DICT[name][3]
sqlalchemy = SQLAlchemy(dialect=dialect) sqlalchemy = SQLAlchemy(dialect=dialect)
sqlalchemy.connect()
try:
sqlalchemy.connect()
except SqlmapConnectionException, msg:
logger.critical(msg)
if sqlalchemy.connector: if sqlalchemy.connector:
conf.dbmsConnector = sqlalchemy conf.dbmsConnector = sqlalchemy

View File

@ -36,7 +36,7 @@ class SQLAlchemy(GenericConnector):
try: try:
if not self.port and self.db: if not self.port and self.db:
if not os.path.exists(self.db): if not os.path.exists(self.db):
raise SqlmapFilePathException, "missing database file '%s'" % self.db raise SqlmapFilePathException, "the provided database file '%s' does not exist" % self.db
_ = conf.direct.split("//", 1) _ = conf.direct.split("//", 1)
conf.direct = "%s////%s" % (_[0], os.path.abspath(self.db)) conf.direct = "%s////%s" % (_[0], os.path.abspath(self.db))