summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2018-08-16 16:27:12 +0300
committerMichael Lando <ml636r@att.com>2018-08-20 02:51:19 +0000
commit3e7c13579da7ff25b308cb577efdd04fd7ca9696 (patch)
treeec73d5cfecd514d2b31e09aa8ae3eff91ecfb5e1 /catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py
parent61919ec216756da63bd43983c3f522b402de4cb6 (diff)
Import normative improvement
Change-Id: I6db32d8107874b2454b75348d909b295030a556f Issue-ID: SDC-557 Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py')
-rw-r--r--catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py
index 51d36586bc..511e8417e4 100644
--- a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py
+++ b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py
@@ -1,5 +1,6 @@
import pycurl
import sys, getopt
+import zipfile
from StringIO import StringIO
import json
import copy
@@ -37,8 +38,13 @@ def createNormativeType(scheme, beHost, bePort, adminUser, fileDir, ELEMENT_NAME
#c.setopt(pycurl.HTTPHEADER, ['Content-Type: application/json', 'Accept: application/json', adminHeader])
c.setopt(pycurl.HTTPHEADER, [adminHeader])
-
+ yml_path = fileDir + ELEMENT_NAME + "/" + ELEMENT_NAME + ".yml"
path = fileDir + ELEMENT_NAME + "/" + ELEMENT_NAME + ".zip"
+
+ zf = zipfile.ZipFile(path, "w")
+ zf.write(yml_path, ELEMENT_NAME + '.yml')
+ zf.close()
+
debug(path)
CURRENT_JSON_FILE=fileDir + ELEMENT_NAME + "/" + ELEMENT_NAME + ".json"
#sed -i 's/"userId": ".*",/"userId": "'${USER_ID}'",/' ${CURRENT_JSON_FILE}