Fix ci broken for Debian 12

Change-Id: I82b6fcccb99e01b0790a4037d9c3dff0a5f1c99f
This commit is contained in:
hwang 2023-12-12 16:50:39 -08:00
parent f5230aa5e3
commit 51350eabbe
4 changed files with 19 additions and 13 deletions

View File

@ -10,5 +10,7 @@ redis-server [platform:dpkg]
dev-db/redis [platform:gentoo] dev-db/redis [platform:gentoo]
default-libmysqlclient-dev [platform:dpkg] default-libmysqlclient-dev [platform:dpkg]
libmysqlclient-devel [platform:suse] libmysqlclient-devel [platform:suse]
mysql-client [platform:dpkg] mysql-client [platform:dpkg !platform:debian]
mysql-server [platform:dpkg] mysql-server [platform:dpkg !platform:debian]
mariadb-client [platform:debian]
mariadb-server [platform:debian]

View File

@ -44,11 +44,20 @@ if [[ $ubuntu_version == '22.04' ]]; then
sudo apt install -y mongodb-org sudo apt install -y mongodb-org
sudo systemctl restart mongod sudo systemctl restart mongod
sudo systemctl status mongod sudo systemctl status mongod
elif [[ $ubuntu_version == '12' ]]; then
wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
echo "deb http://security.ubuntu.com/ubuntu bionic-security main" | sudo tee /etc/apt/sources.list.d/bionic-security.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt update
sudo apt install -y libssl1.1
sudo apt install -y mongodb-org
sudo systemctl restart mongod
sudo systemctl status mongod
else else
sudo apt-get install -y mongodb sudo apt-get install -y mongodb
sudo systemctl restart mongodb sudo systemctl restart mongodb
fi fi
sudo apt install -y pip sudo apt install -y pip python3-setuptools
pip install setuptools
sudo python3 setup.py install sudo python3 setup.py install

View File

@ -30,7 +30,6 @@ postgres=# create database openstack_citest with owner openstack_citest;
""" """
from oslo_db.sqlalchemy import test_base
from oslo_db.sqlalchemy import utils as db_utils from oslo_db.sqlalchemy import utils as db_utils
from zaqar.tests.unit.storage.sqlalchemy_migration import \ from zaqar.tests.unit.storage.sqlalchemy_migration import \
@ -168,6 +167,5 @@ class ZaqarMigrationsCheckers(object):
class TestMigrationsMySQL(ZaqarMigrationsCheckers, class TestMigrationsMySQL(ZaqarMigrationsCheckers,
base.BaseWalkMigrationTestCase, base.BaseWalkMigrationTestCase):
test_base.MySQLOpportunisticTestCase):
pass pass

View File

@ -95,8 +95,7 @@ class Listing(object):
entry['pool_list'] = pool_name_list entry['pool_list'] = pool_name_list
if detailed: if detailed:
caps = self._pools_ctrl.capabilities(flavor=entry) caps = self._pools_ctrl.capabilities(flavor=entry)
entry['capabilities'] = [str(cap).split('.')[-1] entry['capabilities'] = [cap.name for cap in caps]
for cap in caps]
if detailed is not None: if detailed is not None:
store['detailed'] = detailed store['detailed'] = detailed
@ -149,8 +148,7 @@ class Resource(object):
try: try:
data = self._ctrl.get(flavor, project=project_id) data = self._ctrl.get(flavor, project=project_id)
capabilities = self._pools_ctrl.capabilities(flavor=data) capabilities = self._pools_ctrl.capabilities(flavor=data)
data['capabilities'] = [str(cap).split('.')[-1] data['capabilities'] = [cap.name for cap in capabilities]
for cap in capabilities]
pool_list =\ pool_list =\
list(self._pools_ctrl.get_pools_by_flavor(flavor=data)) list(self._pools_ctrl.get_pools_by_flavor(flavor=data))
pool_name_list = [] pool_name_list = []
@ -307,8 +305,7 @@ class Resource(object):
self._ctrl.update(flavor, project=project_id, self._ctrl.update(flavor, project=project_id,
capabilities=capabilities) capabilities=capabilities)
resp_data = self._ctrl.get(flavor, project=project_id) resp_data = self._ctrl.get(flavor, project=project_id)
resp_data['capabilities'] = [str(cap).split('.')[-1] resp_data['capabilities'] = [cap.name for cap in capabilities]
for cap in capabilities]
except errors.FlavorDoesNotExist as ex: except errors.FlavorDoesNotExist as ex:
LOG.exception('Flavor "%s" does not exist', flavor) LOG.exception('Flavor "%s" does not exist', flavor)
raise wsgi_errors.HTTPNotFound(str(ex)) raise wsgi_errors.HTTPNotFound(str(ex))