Fix solum ci
Change-Id: I1677f0092d9674f1643add76f42dfa47ef6dc83a
This commit is contained in:
parent
bdb968144c
commit
d82f2ccde9
|
@ -1,4 +1,5 @@
|
||||||
- project:
|
- project:
|
||||||
|
queue: solum
|
||||||
templates:
|
templates:
|
||||||
- openstack-cover-jobs
|
- openstack-cover-jobs
|
||||||
- openstack-python3-zed-jobs
|
- openstack-python3-zed-jobs
|
||||||
|
@ -14,7 +15,6 @@
|
||||||
- solum-tox-bandit-baseline:
|
- solum-tox-bandit-baseline:
|
||||||
voting: false
|
voting: false
|
||||||
gate:
|
gate:
|
||||||
queue: solum
|
|
||||||
jobs:
|
jobs:
|
||||||
- solum-devstack
|
- solum-devstack
|
||||||
- solum-tempest-ipv6-only
|
- solum-tempest-ipv6-only
|
||||||
|
|
|
@ -18,7 +18,7 @@ Includes decorator for re-raising Solum-type exceptions.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import collections
|
from collections import abc
|
||||||
import functools
|
import functools
|
||||||
import inspect
|
import inspect
|
||||||
import sys
|
import sys
|
||||||
|
@ -191,7 +191,7 @@ def wrap_wsme_pecan_controller_exception(func):
|
||||||
@functools.wraps(func)
|
@functools.wraps(func)
|
||||||
def wrapped(*args, **kw):
|
def wrapped(*args, **kw):
|
||||||
ret = func(*args, **kw)
|
ret = func(*args, **kw)
|
||||||
ismapping = isinstance(ret, collections.Mapping)
|
ismapping = isinstance(ret, abc.Mapping)
|
||||||
if (pecan.response.status_code >= 500 and ismapping):
|
if (pecan.response.status_code >= 500 and ismapping):
|
||||||
|
|
||||||
log_correlation_id = uuidutils.generate_uuid()
|
log_correlation_id = uuidutils.generate_uuid()
|
||||||
|
|
|
@ -13,19 +13,22 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import threading
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_db.sqlalchemy import session
|
from oslo_db.sqlalchemy import session
|
||||||
|
|
||||||
|
|
||||||
_FACADE = None
|
_FACADE = None
|
||||||
|
_LOCK = threading.Lock()
|
||||||
|
|
||||||
|
|
||||||
def get_facade():
|
def get_facade():
|
||||||
global _FACADE
|
global _LOCK, _FACADE
|
||||||
|
if _FACADE is None:
|
||||||
if not _FACADE:
|
with _LOCK:
|
||||||
_FACADE = session.EngineFacade.from_config(cfg.CONF)
|
if _FACADE is None:
|
||||||
|
_FACADE = session.EngineFacade.from_config(cfg.CONF)
|
||||||
return _FACADE
|
return _FACADE
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,8 +36,10 @@ def get_engine():
|
||||||
return get_facade().get_engine()
|
return get_facade().get_engine()
|
||||||
|
|
||||||
|
|
||||||
def get_session():
|
def get_session(autocommit=True, expire_on_commit=False):
|
||||||
return get_facade().get_session()
|
facade = get_facade()
|
||||||
|
return facade.get_session(autocommit=autocommit,
|
||||||
|
expire_on_commit=expire_on_commit)
|
||||||
|
|
||||||
|
|
||||||
def get_backend():
|
def get_backend():
|
||||||
|
|
|
@ -186,6 +186,7 @@ class SolumBase(models.TimestampMixin, models.ModelBase):
|
||||||
with session.begin():
|
with session.begin():
|
||||||
session.merge(self)
|
session.merge(self)
|
||||||
|
|
||||||
|
@retry
|
||||||
def create(self, context):
|
def create(self, context):
|
||||||
session = SolumBase.get_session()
|
session = SolumBase.get_session()
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue