diff options
author | Tim Rozet <trozet@redhat.com> | 2015-08-26 16:00:40 -0400 |
---|---|---|
committer | Tim Rozet <trozet@redhat.com> | 2015-08-28 12:51:44 -0400 |
commit | 24f395d3bf5b6bf3c123a152cae044d156b7a7d9 (patch) | |
tree | db7a4d4e9f7297cc49886a4607260cec4d9e907d | |
parent | cdd5f89faafee6347671ae0a386ad3a78905610f (diff) |
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 <trozet@redhat.com>
-rwxr-xr-x | foreman/ci/deploy.sh | 6 |
1 files changed, 3 insertions, 3 deletions
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 |