summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocker/docker-entrypoint.sh1
-rw-r--r--genericparser/packages/biz/sdc_vnf_package.py4
-rw-r--r--genericparser/packages/biz/vnf_package.py2
-rw-r--r--genericparser/packages/biz/vnf_pkg_artifacts.py5
-rw-r--r--genericparser/packages/tests/const.py2
-rw-r--r--genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_251.py4
-rw-r--r--genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_base.py4
-rwxr-xr-xstop.sh2
8 files changed, 14 insertions, 10 deletions
diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh
index a093691..1e2e16a 100755
--- a/docker/docker-entrypoint.sh
+++ b/docker/docker-entrypoint.sh
@@ -1,5 +1,6 @@
#!/bin/bash
+sudo chown onap:onap -R /service
find /service -name '*.sh'|xargs chmod a+x
if [ -z "$SERVICE_IP" ]; then
diff --git a/genericparser/packages/biz/sdc_vnf_package.py b/genericparser/packages/biz/sdc_vnf_package.py
index afd219a..5028709 100644
--- a/genericparser/packages/biz/sdc_vnf_package.py
+++ b/genericparser/packages/biz/sdc_vnf_package.py
@@ -130,14 +130,14 @@ class NfDistributeThread(threading.Thread):
vnfd = json.JSONDecoder().decode(vnfd_json)
if not vnfd.get("vnf"):
- raise GenericparserException("VNF propeties and metadata in VNF Package(id=%s) are empty." % self.csar_id)
+ raise GenericparserException("VNF properties and metadata in VNF Package(id=%s) are empty." % self.csar_id)
vnfd_id = vnfd["vnf"]["properties"].get("descriptor_id", "")
if VnfPackageModel.objects.filter(vnfdId=vnfd_id):
logger.error("VNF package(%s) already exists.", vnfd_id)
raise GenericparserException("VNF package(%s) already exists." % vnfd_id)
JobUtil.add_job_status(self.job_id, 30, "Save CSAR(%s) to database." % self.csar_id)
- vnfd_ver = vnfd["vnf"]["properties"].get("descriptor_verison", "")
+ vnfd_ver = vnfd["vnf"]["properties"].get("descriptor_version", "")
vnf_provider = vnfd["vnf"]["properties"].get("provider", "")
vnf_software_version = vnfd["vnf"]["properties"].get("software_version", "")
vnfd_product_name = vnfd["vnf"]["properties"].get("product_name", "")
diff --git a/genericparser/packages/biz/vnf_package.py b/genericparser/packages/biz/vnf_package.py
index b655f1f..7186082 100644
--- a/genericparser/packages/biz/vnf_package.py
+++ b/genericparser/packages/biz/vnf_package.py
@@ -201,7 +201,7 @@ def parse_vnfd_and_save(vnf_pkg_id, vnf_pkg_path):
logger.error("VNF package(%s,%s) already exists.", other_pkg[0].vnfPackageId, vnfd_id)
raise GenericparserException("VNF package(%s) already exists." % vnfd_id)
vnf_provider = vnfd["vnf"]["properties"].get("provider", "")
- vnfd_ver = vnfd["vnf"]["properties"].get("descriptor_verison", "")
+ vnfd_ver = vnfd["vnf"]["properties"].get("descriptor_version", "")
vnf_software_version = vnfd["vnf"]["properties"].get("software_version", "")
vnfd_product_name = vnfd["vnf"]["properties"].get("product_name", "")
vnf_pkg.update(
diff --git a/genericparser/packages/biz/vnf_pkg_artifacts.py b/genericparser/packages/biz/vnf_pkg_artifacts.py
index f2506da..3a54f02 100644
--- a/genericparser/packages/biz/vnf_pkg_artifacts.py
+++ b/genericparser/packages/biz/vnf_pkg_artifacts.py
@@ -36,5 +36,8 @@ class FetchVnfPkgArtifact(object):
artifact_path = fileutil.get_artifact_path(vnf_extract_path, artifactPath)
if not artifact_path:
raise ArtifactNotFoundException("Couldn't artifact %s" % artifactPath)
- file_content = open(artifact_path, 'rb').read()
+ with open(artifact_path, 'rb') as f:
+ file_content = f.read()
+ else:
+ raise ArtifactNotFoundException("NF Package format is not csar or zip")
return file_content
diff --git a/genericparser/packages/tests/const.py b/genericparser/packages/tests/const.py
index a98ccb6..991c87c 100644
--- a/genericparser/packages/tests/const.py
+++ b/genericparser/packages/tests/const.py
@@ -218,7 +218,7 @@ vnfd_data = {
"vnf": {
"properties": {
"descriptor_id": "zte-hss-1.0",
- "descriptor_verison": "1.0.0",
+ "descriptor_version": "1.0.0",
"software_version": "1.0.0",
"provider": "zte"
},
diff --git a/genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_251.py b/genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_251.py
index d6c15de..d2f1229 100644
--- a/genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_251.py
+++ b/genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_251.py
@@ -40,11 +40,11 @@ class VnfdSOL251():
descriptor_id = metadata.get("UUID", "")
properties["descriptor_id"] = descriptor_id
- if properties.get("descriptor_verison", "") == "":
+ if properties.get("descriptor_version", "") == "":
version = metadata.get("template_version", "")
if version == "":
version = metadata.get("version", "")
- properties["descriptor_verison"] = version
+ properties["descriptor_version"] = version
if properties.get("provider", "") == "":
provider = metadata.get("template_author", "")
diff --git a/genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_base.py b/genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_base.py
index d14b380..89ddc84 100644
--- a/genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_base.py
+++ b/genericparser/pub/utils/toscaparsers/vnfdparser/vnfd_sol_base.py
@@ -40,11 +40,11 @@ class VnfdSOLBase():
descriptor_id = metadata.get("UUID", "")
properties["descriptor_id"] = descriptor_id
- if properties.get("descriptor_verison", "") == "":
+ if properties.get("descriptor_version", "") == "":
version = metadata.get("template_version", "")
if version == "":
version = metadata.get("version", "")
- properties["descriptor_verison"] = version
+ properties["descriptor_version"] = version
if properties.get("provider", "") == "":
provider = metadata.get("template_author", "")
diff --git a/stop.sh b/stop.sh
index a2fa2ae..e533560 100755
--- a/stop.sh
+++ b/stop.sh
@@ -14,4 +14,4 @@
# limitations under the License.
# ps auxww | grep "manage.py runserver 0.0.0.0:8806" | awk '{print $2}' | xargs kill -9
-ps auxww |grep 'uwsgi --http :8806 --module genericparser.wsgi --master' |awk '{print $2}' |xargs kill -9
+ps auxww |grep 'uwsgi --http' |awk '{print $1}' |xargs kill -9