From 0a797c86de8ec43931ae51ed4233f6bb1717c0ef Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Fri, 11 Apr 2014 14:16:10 -0400 Subject: [PATCH] Remove cloudy interfaces in dhcp-all-interfaces Moves the code that removes default cloud interfaces into the dhcp-all-interfaces element. Having it live in stable-interface-names won't work right now because we need this for virtualized testing. Change-Id: I3166951c6fbb2faec53ffc339edd2fd0c3512300 --- .../install.d/60-remove-cloud-image-interfaces | 16 ++++++++++++++++ .../install.d/02-stable-interface-names | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) create mode 100755 elements/dhcp-all-interfaces/install.d/60-remove-cloud-image-interfaces diff --git a/elements/dhcp-all-interfaces/install.d/60-remove-cloud-image-interfaces b/elements/dhcp-all-interfaces/install.d/60-remove-cloud-image-interfaces new file mode 100755 index 00000000..6d5cf730 --- /dev/null +++ b/elements/dhcp-all-interfaces/install.d/60-remove-cloud-image-interfaces @@ -0,0 +1,16 @@ +#!/bin/bash + +# Cloud images may hard code the eth0 interfaces so they +# boots w/ DHCP. + +# Fedora +IFCFG_NETSCRIPT="/etc/sysconfig/network-scripts/ifcfg-eth0" +if [ -f $IFCFG_NETSCRIPT ]; then + rm $IFCFG_NETSCRIPT +fi + +# Ubuntu +ENI_ETH0_CFG="/etc/network/interfaces.d/eth0.cfg" +if [ -f $ENI_ETH0_CFG ]; then + rm $ENI_ETH0_CFG +fi diff --git a/elements/stable-interface-names/install.d/02-stable-interface-names b/elements/stable-interface-names/install.d/02-stable-interface-names index 8822c737..fd493d48 100755 --- a/elements/stable-interface-names/install.d/02-stable-interface-names +++ b/elements/stable-interface-names/install.d/02-stable-interface-names @@ -7,19 +7,3 @@ if [ -h $NET_NAME_SLOT_FILE ]; then fi install-packages biosdevname - -# Fedora/RHEL cloud images may hard code the eth0 interface -# so it boots w/ DHCP. We remove this file here so it -# doesn't interfere w/ stable interface naming -IFCFG_NETSCRIPT="/etc/sysconfig/network-scripts/ifcfg-eth0" -if [ -f $IFCFG_NETSCRIPT ]; then - rm $IFCFG_NETSCRIPT -fi - -# Ubuntu may hard code the eth0 interface for DHCP -# We remove this file here so it doesn't interfere w/ -# stable interface naming -ENI_ETH0_CFG="/etc/network/interfaces.d/eth0.cfg" -if [ -f $ENI_ETH0_CFG ]; then - rm $ENI_ETH0_CFG -fi