aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog/packages/biz/vnf_pkg_artifacts.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/catalog/packages/biz/vnf_pkg_artifacts.py b/catalog/packages/biz/vnf_pkg_artifacts.py
index d8a77488..bb79624b 100644
--- a/catalog/packages/biz/vnf_pkg_artifacts.py
+++ b/catalog/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