Checking that the netcfg is correctly loaded in ONOS

Change-Id: Ib559c860162f3e8e06780a9332c814d7a3ea9ba3
diff --git a/voltha-infra/Chart.yaml b/voltha-infra/Chart.yaml
index b7ce2e9..9732314 100644
--- a/voltha-infra/Chart.yaml
+++ b/voltha-infra/Chart.yaml
@@ -29,7 +29,7 @@
 name: voltha-infra
 
 appVersion: "1.0"
-version: 0.1.7
+version: 0.1.8
 
 dependencies:
   - name: onos-classic
diff --git a/voltha-infra/templates/onos-config-loader-script.yaml b/voltha-infra/templates/onos-config-loader-script.yaml
index fd74f58..dd18a41 100644
--- a/voltha-infra/templates/onos-config-loader-script.yaml
+++ b/voltha-infra/templates/onos-config-loader-script.yaml
@@ -23,7 +23,7 @@
 
     # a POST to a non ready netcfg return 207 in case of failure, while a GET returns 404,
     # check the apps key is ready to accept data before sending them
-    
+
     until curl --fail -sSL --user {{ .Values.onos.username }}:{{ .Values.onos.password }} -X GET -H 'Accept: application/json' "http://{{ .Release.Name }}-onos-classic-hs:8181/onos/v1/network/configuration/apps";
     do
       echo -e "Waiting for netcfg to be active";
@@ -31,7 +31,11 @@
     done
 
     echo -e "Loading netcfg into ONOS\n";
-    curl --fail -sSL --user {{ .Values.onos.username }}:{{ .Values.onos.password }} -X POST "http://{{ .Release.Name }}-onos-classic-hs:8181/onos/v1/network/configuration/" -H Content-type:application/json -d @/opt/configs/netcfg.json;
+    responseCode=$(curl --write-out '%{http_code}' --fail -sSL --user {{ .Values.onos.username }}:{{ .Values.onos.password }} -X POST "http://{{ .Release.Name }}-onos-classic-hs:8181/onos/v1/network/configuration/" -H Content-type:application/json -d @/opt/configs/netcfg.json);
+    if [[ $responseCode == 207 ]]; then
+      echo "Failed to load netcfg, exiting..."
+      exit 1
+    fi
 
     echo -e "Loading component configs into ONOS\n";
     CFGS=$(ls /opt/configs | grep -v netcfg.json);