From 20d7c78fb6cacab552ab65528f9d9e75f01f7ec9 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 26 Mar 2025 11:12:53 +0000 Subject: [PATCH] devstack: Be tolerant of existing /etc/apt/sources.list.d dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise installation fails on environments where this already exists with: mkdir: cannot create directory ā€˜/etc/apt/sources.list.dā€™: File exists Change-Id: I10ad400879ae047c6e6248237e980174e0ccb8a9 Signed-off-by: Stephen Finucane --- devstack/plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 82bd5109e..899f6a420 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -170,7 +170,7 @@ function configure_mongodb { # NOTE: To fix the mongodb's issue in ubuntu 22.04/24.04 LTS ubuntu_version=$(source /etc/os-release ; echo $VERSION_ID) if [[ $ubuntu_version == '24.04' ]]; then - sudo mkdir /etc/apt/sources.list.d + sudo mkdir -p /etc/apt/sources.list.d wget -qO - https://www.mongodb.org/static/pgp/server-8.0.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list sudo apt update