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