Add library sourcing error check 55/14755/6
authorFeng Pan <fpan@redhat.com>
Fri, 27 May 2016 00:23:24 +0000 (20:23 -0400)
committerFeng Pan <fpan@redhat.com>
Thu, 2 Jun 2016 21:09:57 +0000 (21:09 +0000)
Change-Id: Ief7fd339fa2ca8661c8e157270aa9b0339d3b637
Signed-off-by: Feng Pan <fpan@redhat.com>
ci/clean.sh
ci/deploy.sh

index ac958f6..b898fc9 100755 (executable)
@@ -18,7 +18,10 @@ RESOURCES=${RESOURCES:-"$CONFIG/images"}
 LIB=${LIB:-"$CONFIG/lib"}
 
 ##LIBRARIES
-source $LIB/common-functions.sh
+if ! source $LIB/common-functions.sh; then
+  echo "Failed to source $LIB/common-functions.sh"
+  exit 1
+fi
 
 vm_index=4
 ovs_bridges="br-admin br-private br-public br-storage"
index bb4c1f8..97ab0e5 100755 (executable)
@@ -55,9 +55,17 @@ ext_net_type="interface"
 ip_address_family=4
 
 # Libraries
-source $LIB/common-functions.sh
-source $LIB/utility-functions.sh
-source $LIB/installer/onos/onos_gw_mac_update.sh
+lib_files=(
+$LIB/common-functions.sh
+$LIB/utility-functions.sh
+$LIB/installer/onos/onos_gw_mac_update.sh
+)
+for lib_file in ${lib_files[@]}; do
+  if ! source $lib_file; then
+    echo -e "${red}ERROR: Failed to source $lib_file${reset}"
+    exit 1
+  fi
+done
 
 ##FUNCTIONS
 ##translates yaml into variables