diff --git a/bootstrap/playbooks/tasks/base.yaml b/bootstrap/playbooks/tasks/base.yaml index 047a4a37..b46d9c7d 100644 --- a/bootstrap/playbooks/tasks/base.yaml +++ b/bootstrap/playbooks/tasks/base.yaml @@ -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 diff --git a/requirements.txt b/requirements.txt index 18d25afb..bf3fd4a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/solar/dblayer/__init__.py b/solar/dblayer/__init__.py index b6577799..5077e8d9 100644 --- a/solar/dblayer/__init__.py +++ b/solar/dblayer/__init__.py @@ -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: