Skip to content
Browse files

Merge pull request #5 from pcdinh/master

Invalid URL parsing
  • Loading branch information...
2 parents bc5f31d + 8d73c4c commit 11fbe849a05453ffdce7b7a8312c5b89f0771a2b @piranha committed Jan 16, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 nomad/engine/dbapi.py
View
6 nomad/engine/dbapi.py
@@ -7,7 +7,7 @@ def path2dict(p, **renames):
'''Convert urlparse result to dict
'''
result = {}
- for k in 'hostname port path user password'.split():
+ for k in 'hostname port path username password'.split():
value = getattr(p, k, None)
if not value:
continue
@@ -73,7 +73,7 @@ class Mysql(Connection):
_conn = None
def __init__(self, path):
self.parameters = path2dict(path, hostname='host',
- password='passwd', path='db')
+ password='passwd', path='db', username='user')
import MySQLdb
self.module = MySQLdb
self.exc = MySQLdb.MySQLError
@@ -100,7 +100,7 @@ def rollback(self):
class Pgsql(Connection):
_conn = None
def __init__(self, path):
- self.parameters = path2dict(path, hostname='host', path='database')
+ self.parameters = path2dict(path, hostname='host', path='database', username='user')
import psycopg2
self.module = psycopg2
self.exc = psycopg2.Error

0 comments on commit 11fbe84

Please sign in to comment.
Something went wrong with that request. Please try again.