Skip to content

Commit

Permalink
Merge pull request #179 from acsone/9.0-mig2-sbi
Browse files Browse the repository at this point in the history
[9.0] adapt to upstream api change to obtain db connection
  • Loading branch information
pedrobaeza committed Mar 3, 2016
2 parents 155f2c9 + 5dcd3c7 commit 895ecd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion connector/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##############################################################################

{'name': 'Connector',
'version': '9.0.1.0.1',
'version': '9.0.1.0.2',
'author': 'Camptocamp,Openerp Connector Core Editors,'
'Odoo Community Association (OCA)',
'website': 'http://odoo-connector.com',
Expand Down
6 changes: 4 additions & 2 deletions connector/jobrunner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def _async_http_get(port, db_name, job_uuid):
# Method to set failed job (due to timeout, etc) as pending,
# to avoid keeping it as enqueued.
def set_job_pending():
conn = psycopg2.connect(openerp.sql_db.dsn(db_name)[1])
connection_info = openerp.sql_db.connection_info_for(db_name)[1]
conn = psycopg2.connect(**connection_info)
conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
with closing(conn.cursor()) as cr:
cr.execute(
Expand Down Expand Up @@ -155,7 +156,8 @@ class Database(object):

def __init__(self, db_name):
self.db_name = db_name
self.conn = psycopg2.connect(openerp.sql_db.dsn(db_name)[1])
connection_info = openerp.sql_db.connection_info_for(db_name)[1]
self.conn = psycopg2.connect(**connection_info)
self.conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
self.has_connector = self._has_connector()
if self.has_connector:
Expand Down

0 comments on commit 895ecd5

Please sign in to comment.