Fix for normative scripts 39/16139/1
authorMichael Lando <ml636r@att.com>
Wed, 27 Sep 2017 23:23:00 +0000 (02:23 +0300)
committerMichael Lando <ml636r@att.com>
Wed, 27 Sep 2017 23:23:00 +0000 (02:23 +0300)
Change-Id: Ibd995c092e45aa1aaedbd687dcc39bf6333a4f3a
Issue-ID: SDC-410
Signed-off-by: Michael Lando <ml636r@att.com>
catalog-be/src/main/resources/scripts/import/tosca/upgradeNormative.py
sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb
sdc-os-chef/sdc-backend/startup.sh

index 085467e..4d0ec29 100644 (file)
@@ -11,6 +11,7 @@ from importPolicyTypes import importPolicyTypes
 from importGroupTypes import importGroupTypes
 from importNormativeCapabilities import importNormativeCapabilities
 from importNormativeInterfaceLifecycleTypes import importNormativeInterfaceLifecycleType
+from importOnapTypes import importOnapTypes
 
 
 from importCommon import *
@@ -112,7 +113,11 @@ def main(argv):
 
        resultsHeat = upgradeTypesPerConfigFile(beHost, bePort, adminUser, baseFileLocation, updateversion)
        handleResults(resultsHeat, 'false')
-
+       
+       fileLocation = baseFileLocation + "onap-types/"
+       resultsHeat = importOnapTypes(beHost, bePort, adminUser, fileLocation, updateversion)
+       handleResults(resultsHeat, updateversion)
+       
        errorAndExit(0, None)
 
 if __name__ == "__main__":
index dc8e4b7..8dff57a 100644 (file)
@@ -10,7 +10,7 @@ bash "import-normatives" do
     tar xvfz /tmp/normatives.tar.gz
     cd normatives/scripts/import/tosca/
     /bin/chmod +x importNormativeAll.py
-    python importNormativeAll.py -i "#{node['HOST_IP']}" --debug=true > /var/lib/jetty/logs/importNormativeAll.log
+    python importNormativeAll.py -i localhost --debug=true > /var/lib/jetty/logs/importNormativeAll.log
   EOH
 end
 
index 98699d9..a0c237d 100644 (file)
@@ -26,7 +26,7 @@ python /root/chef-solo/cookbooks/sdc-normatives/files/default/check_Backend_Heal
 # executing the normatives
 cd /root/chef-solo
 check_normative="/tmp/check_normative.out"
-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" -H "Cache-Control: no-cache" -H "Postman-Token: af08ca1c-302f-1431-404f-ed84246e07c9" "http://${HOST_IP}:8080/sdc2/rest/v1/screen" > ${check_normative}
+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" -H "Cache-Control: no-cache" -H "Postman-Token: af08ca1c-302f-1431-404f-ed84246e07c9" "http://localhost:8080/sdc2/rest/v1/screen" > ${check_normative}
 
 echo "normal['HOST_IP'] = \"${HOST_IP}\"" > /root/chef-solo/cookbooks/sdc-normatives/attributes/default.rb
 resources_len=`cat ${check_normative}| jq '.["resources"]|length'`