From d5f8581e265a0227040488a1b565a0dc6faf9f13 Mon Sep 17 00:00:00 2001 From: Bob Fournier Date: Mon, 26 Mar 2018 10:09:08 -0400 Subject: [PATCH] Remove config.json for old style nic config files when using new style This removes the config.json used by os-apply-config for old style nic config files in the script invoked for new style nic config files. This will avoid the case when the network files are set up by run-os-net-config.sh and then later overwritten by os-apply-config. Change-Id: I8f17a53c392aac657b00afdecbb5e58a2e192787 Closes-Bug: 1758161 (cherry picked from commit 9f4c691ccae4be6aa93e40450717b35f16a2a655) --- network/scripts/run-os-net-config.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/network/scripts/run-os-net-config.sh b/network/scripts/run-os-net-config.sh index 32a507c5c8..cc3d2b04be 100755 --- a/network/scripts/run-os-net-config.sh +++ b/network/scripts/run-os-net-config.sh @@ -146,4 +146,12 @@ if [ -n '$network_config' ]; then echo "ERROR: os-net-config configuration failed." >&2 exit 1 fi + + # Remove files used by os-apply-config for old style configs + if [ -f /usr/libexec/os-apply-config/templates/etc/os-net-config/config.json ]; then + rm /usr/libexec/os-apply-config/templates/etc/os-net-config/config.json + fi + if [ -f /usr/libexec/os-apply-config/templates/etc/os-net-config/element_config.json ]; then + rm /usr/libexec/os-apply-config/templates/etc/os-net-config/element_config.json + fi fi