This commit is contained in:
Miroslav Stampar 2010-03-30 11:21:26 +00:00
parent 87d8c6719e
commit 738c210075

View File

@ -606,20 +606,25 @@ def parseTargetDirect():
details = None details = None
for dbms in SUPPORTED_DBMS: for dbms in SUPPORTED_DBMS:
details = re.search("^(?P<dbms>%s)://(?P<optional>(?P<dbmsUser>.+?)\:(?P<dbmsPass>.+?)\@(?P<hostname>.+?)\:(?P<port>[\d]+)\/)?(?P<dbmsDb>.+?)$" % dbms, conf.direct, re.I) details = re.search("^(?P<dbms>%s)://(?P<credentials>(?P<dbmsUser>.+?)\:(?P<dbmsPass>.+?)\@)(?P<remote>(?P<hostname>.+?)\:(?P<port>[\d]+)\/)?(?P<dbmsDb>.+?)$" % dbms, conf.direct, re.I)
if details: if details:
conf.dbms = details.group('dbms') conf.dbms = details.group('dbms')
if details.group('optional'):
if details.group('credentials'):
conf.dbmsUser = details.group('dbmsUser') conf.dbmsUser = details.group('dbmsUser')
conf.dbmsPass = details.group('dbmsPass') conf.dbmsPass = details.group('dbmsPass')
conf.hostname = details.group('hostname')
conf.port = int(details.group('port'))
else: else:
conf.dbmsUser = str() conf.dbmsUser = str()
conf.dbmsPass = str() conf.dbmsPass = str()
if details.group('remote'):
conf.hostname = details.group('hostname')
conf.port = int(details.group('port'))
else:
conf.hostname = "localhost" conf.hostname = "localhost"
conf.port = 0 conf.port = 0
conf.dbmsDb = details.group('dbmsDb') conf.dbmsDb = details.group('dbmsDb')
conf.parameters[None] = "direct connection" conf.parameters[None] = "direct connection"