1 cookbook_file "/tmp/normatives.tar.gz" do
2 source "normatives.tar.gz"
5 be_ip=node['Nodes'][:BE]
7 bash "excuting-import_Normatives" do
11 tar xvfz /tmp/normatives.tar.gz
12 cd /tmp/normatives/scripts/import/tosca/
15 # executing the normatives
16 # add --debug=true to the importNormativeAll.py arguments to enable debug
18 check_normative="/tmp/check_normative.out"
19 curl -s -X GET -H "Content-Type: application/json;charset=UTF-8" -H "USER_ID: jh0003" -H "X-ECOMP-RequestID: cbe744a0-037b-458f-aab5-df6e543c4090" "http://#{be_ip}:8080/sdc2/rest/v1/screen" > ${check_normative}
21 resources_len=`cat ${check_normative}| jq '.["resources"]|length'`
22 if [ $resources_len -eq 0 ] ; then
23 python importONAPNormativeAll.py -i #{be_ip} > /var/lib/jetty/logs/importNormativeAll.log
25 if [[ $rc != 0 ]]; then exit $rc; fi
27 python upgradeONAPNormative.py -i #{be_ip} > /var/lib/jetty/logs/upgradeNormative.log
29 if [[ $rc != 0 ]]; then exit $rc; fi