diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 72d6c36dbe..0585a4049c 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -3516,12 +3516,19 @@ function downgrade_dnsmasq { # NOTE(TheJulia): The intent here is to use dnsmasq version # which does not crash on segfaults or sigabort when configuration # is updated. See https://bugs.launchpad.net/ironic/+bug/2026757 - sudo dpkg -r dnsmasq-base - git clone http://thekelleys.org.uk/git/dnsmasq.git -b v2.85 --depth 1 - pushd dnsmasq - sed -i 's|^PREFIX.*|PREFIX = /usr|' Makefile - sudo make install - popd + if dnsmasq --version | grep -q "Dnsmasq version 2.85"; then + # NOTE(JayF) Keep Ironic devstack plugin idempotent by skipping + # downgrade if we already have the desired version. + echo "Dnsmasq already downgraded, continuing..." + else + echo "Downgrading dnsmasq..." + sudo dpkg -r dnsmasq-base + git clone http://thekelleys.org.uk/git/dnsmasq.git -b v2.85 --depth 1 + pushd dnsmasq + sed -i 's|^PREFIX.*|PREFIX = /usr|' Makefile + sudo make install + popd + fi } # Restore xtrace + pipefail