From 24f395d3bf5b6bf3c123a152cae044d156b7a7d9 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Wed, 26 Aug 2015 16:00:40 -0400 Subject: Fixes bug with interface detection This patch addresses the detection of the physical NICs to bridge to. There was a bug where the regexp would ignore some NICs on accident, and the purpose of the expression was to ignore virtual NICs. Rather than ignore NICs by their name, this patch ensures that NICs are ignored if they are actually virtual types. Also fixes syntax issue with checking for nic_arg_flag. JIRA: APEX-11 Change-Id: Ibd965c454faab1d751e3ce0b260eabc7fbe7c720 Signed-off-by: Tim Rozet --- foreman/ci/deploy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'foreman/ci') diff --git a/foreman/ci/deploy.sh b/foreman/ci/deploy.sh index a978e38..59254d1 100755 --- a/foreman/ci/deploy.sh +++ b/foreman/ci/deploy.sh @@ -324,7 +324,7 @@ parse_cmdline() { fi ##Validate nic args - if [ $nic_arg_flag -eq 1 ]; then + if [[ $nic_arg_flag -eq 1 ]]; then if [ -z "$virtual" ]; then for nic_type in admin_nic private_nic public_nic; do eval "nic_value=\$$nic_type" @@ -500,7 +500,7 @@ configure_network() { ##if nic_arg_flag is set, then we don't figure out ##NICs dynamically - if [ $nic_arg_flag -eq 1 ]; then + if [[ $nic_arg_flag -eq 1 ]]; then echo "${blue}Static Network Interfaces Defined. Updating Vagrantfile...${reset}" if [ $virtual ]; then nic_list="$public_nic" @@ -516,7 +516,7 @@ configure_network() { echo "${blue}Detecting network configuration...${reset}" ##detect host 1 or 3 interface configuration #output=`ip link show | grep -E "^[0-9]" | grep -Ev ": lo|tun|virbr|vboxnet" | awk '{print $2}' | sed 's/://'` - output=`ifconfig | grep -E "^[a-zA-Z0-9]+:"| grep -Ev "lo|tun|virbr|vboxnet" | awk '{print $1}' | sed 's/://'` + output=`/bin/ls -l /sys/class/net | tail -n +2 | grep -v virtual | cut -d " " -f9` fi if [ ! "$output" ]; then -- cgit 1.2.3-korg