Use psycogreen for PG backend

Change-Id: Ia2037cf26614cb4091a5c57a94a3c3a0af0ed70c
Closes-bug: #1546976
This commit is contained in:
Jedrzej Nowak 2016-02-18 12:16:05 +01:00
parent 302affe6aa
commit 300798c8f2
3 changed files with 7 additions and 0 deletions

View File

@ -55,6 +55,8 @@
- tox
- riak
- pbr
# for pg backend
- psycogreen
# pre install solare requirements
- shell: pip install -r https://raw.githubusercontent.com/openstack/solar/master/requirements.txt

View File

@ -29,6 +29,7 @@ wrapt
peewee
# if you want to use sql + postgresql then
# psycopg2
# psycogreen
# if you want to use lua computable inputs
# lupa

View File

@ -64,7 +64,11 @@ elif _connection.mode == 'riak':
elif _connection.mode == 'postgresql':
# TODO: collation has to be `C`
import psycogreen.gevent
psycogreen.gevent.patch_psycopg()
from solar.dblayer.sql_client import SqlClient
opts = {'autocommit': False}
opts.update(_connection_details.toDict())
if _connection.port: