X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fcommon-functions.sh;h=709dbf97437ac05db724b85697c59022b33105cb;hb=605342b46095341c9301456c81e354c73e2197eb;hp=6941093c486067c224f169083c78062d2af7aa71;hpb=80783b3b94f3f1dba94bcb15d43be311e157120e;p=apex.git diff --git a/lib/common-functions.sh b/lib/common-functions.sh index 6941093c..709dbf97 100644 --- a/lib/common-functions.sh +++ b/lib/common-functions.sh @@ -33,12 +33,12 @@ function find_ip { af=$2 fi - python3.4 -B $LIB/python/apex_python_utils.py find-ip -i $1 -af $af + python3 -B $LIB/python/apex_python_utils.py find-ip -i $1 -af $af } ##attach interface to OVS and set the network config correctly ##params: bride to attach to, interface to attach, network type (optional) -##public indicates attaching to a public interface +##external indicates attaching to a external interface function attach_interface_to_ovs { local bridge interface local if_ip if_mask if_gw if_file ovs_file if_prefix @@ -72,15 +72,15 @@ function attach_interface_to_ovs { if [ -z "$if_mask" ]; then # we can look for PREFIX here, then convert it to NETMASK - if_prefix=$(sed -n 's/^PREFIX=\(.*\)$/\1/p' ${if_file}) + if_prefix=$(sed -n 's/^PREFIX=[^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1/p' ${if_file}) if_mask=$(prefix2mask ${if_prefix}) fi if [[ -z "$if_ip" || -z "$if_mask" ]]; then echo "ERROR: IPADDR or NETMASK/PREFIX missing for ${interface}" return 1 - elif [[ -z "$if_gw" && "$3" == "public_network" ]]; then - echo "ERROR: GATEWAY missing for ${interface}, which is public" + elif [[ -z "$if_gw" && "$3" == "external" ]]; then + echo "ERROR: GATEWAY missing for ${interface}, which is external" return 1 fi @@ -281,7 +281,7 @@ contains_prefix() { #params: none function verify_internet { if ping -c 2 $ping_site > /dev/null; then - if ping -c 2 www.google.com > /dev/null; then + if ping -c 2 $dnslookup_site > /dev/null; then echo "${blue}Internet connectivity detected${reset}" return 0 else