Replace oslo_utils.fnmatch with fnmatch

The oslo_utils.fnmatch module was added to solve an issue in py2.7 but
it is no longer required because py2.7 is no longer supported.
The module was deprecated since oslo.utils 4.9.1[1] and the stdlib's
fnmatch module should be used instead.

SQLAlchemy url is now immutable
Use URL.set to update

Co-authored by: Takashi Kajinami
[1] 4c893c92f551c9dd2a7cfbe7ae8171ad8139df0b

Change-Id: I59c4d93a5914b8e14f7ef93bcaff8d1caaf5e75a
This commit is contained in:
Matthias Runge 2021-07-08 17:09:07 +02:00
parent 8404e9ac74
commit 7a166e05f7
3 changed files with 7 additions and 6 deletions

View File

@ -12,12 +12,12 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import fnmatch
import json
import operator
from oslo_config import cfg
from oslo_log import log
from oslo_utils import fnmatch
from oslo_utils import timeutils
from aodh import evaluator

View File

@ -18,7 +18,7 @@ import os.path
from alembic import command
from alembic import config
from alembic import migration
from oslo_db.sqlalchemy import session as db_session
from oslo_db.sqlalchemy import enginefacade
from oslo_db.sqlalchemy import utils as oslo_sql_utils
from oslo_log import log
from oslo_utils import importutils
@ -109,8 +109,9 @@ class Connection(base.Connection):
# oslo.db doesn't support options defined by Aodh
for opt in storage.OPTS:
options.pop(opt.name, None)
self._engine_facade = db_session.EngineFacade(self.dress_url(url),
**options)
self._engine_facade = enginefacade.LegacyEngineFacade(
self.dress_url(url),
**options)
if osprofiler_sqlalchemy:
osprofiler_sqlalchemy.add_tracing(sqlalchemy,
@ -123,7 +124,7 @@ class Connection(base.Connection):
# If no explicit driver has been set, we default to pymysql
if url.startswith("mysql://"):
url = sqlalchemy_url.make_url(url)
url.drivername = "mysql+pymysql"
url = url.set(drivername="mysql+pymysql")
return str(url)
return url

View File

@ -26,7 +26,7 @@ python-keystoneclient>=1.6.0
pytz>=2013.6
requests>=2.5.2
stevedore>=1.5.0 # Apache-2.0
sqlalchemy
sqlalchemy>=1.4.1
tooz>=1.28.0 # Apache-2.0
voluptuous>=0.8.10
WebOb>=1.2.3