diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 1a3189e97..28d799467 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -176,10 +176,10 @@ function configure_mongodb { pip_install pymongo if is_ubuntu; then # NOTE: To fix the mongodb's issue in ubuntu 22.04 LTS - ubuntu_version=`cat /etc/issue | cut -d " " -f2` - if [[ $ubuntu_version > '22' ]]; then + ubuntu_version=$(source /etc/os-release ; echo $VERSION_ID) + if [[ $ubuntu_version == '22.04' ]]; then wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list sudo apt update curl -LO http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.21_amd64.deb sudo dpkg -i ./libssl1.1_1.1.1-1ubuntu2.1~18.04.21_amd64.deb diff --git a/tools/test-setup.sh b/tools/test-setup.sh index 7bfbdecb6..0dd81dbd4 100755 --- a/tools/test-setup.sh +++ b/tools/test-setup.sh @@ -33,10 +33,10 @@ mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e " CREATE DATABASE openstack_citest CHARACTER SET utf8;" # TO fix the mongodb issue in ubuntu 22.04 -ubuntu_version=`cat /etc/issue | cut -d " " -f2` -if [[ $ubuntu_version > '22' ]]; then +ubuntu_version=$(source /etc/os-release ; echo $VERSION_ID) +if [[ $ubuntu_version == '22.04' ]]; then wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list sudo apt update curl -LO http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.21_amd64.deb sudo dpkg -i ./libssl1.1_1.1.1-1ubuntu2.1~18.04.21_amd64.deb