Making sure an app is ready to accept a config when configuring ONOS

Change-Id: Idc4d992cd1378a52de9141898094e9f2b17592a7
diff --git a/voltha-infra/Chart.yaml b/voltha-infra/Chart.yaml
index 55ad68b..28ae037 100644
--- a/voltha-infra/Chart.yaml
+++ b/voltha-infra/Chart.yaml
@@ -29,7 +29,7 @@
 name: voltha-infra
 
 appVersion: "1.0"
-version: 0.1.9
+version: 0.1.10
 
 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 dd18a41..b4578d8 100644
--- a/voltha-infra/templates/onos-config-loader-script.yaml
+++ b/voltha-infra/templates/onos-config-loader-script.yaml
@@ -48,5 +48,9 @@
         sleep 5;
       done
       echo -e "Loading $CFG config";
-      curl --fail -sSL --user {{ .Values.onos.username }}:{{ .Values.onos.password }} -X POST "http://{{ .Release.Name }}-onos-classic-hs:8181/onos/v1/configuration/$CFG" -H Content-type:application/json -d @/opt/configs/$CFG;
+      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/configuration/$CFG" -H Content-type:application/json -d @/opt/configs/$CFG);
+      if [[ $responseCode == 207 ]]; then
+        echo "Failed to load $CFG, exiting..."
+        exit 1
+      fi
     done