X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=genericparser%2Fpackages%2Fbiz%2Fvnf_pkg_artifacts.py;h=3a54f02e970d5ddcdaf1542fea5bcf5e9d7f01bf;hb=8cb9e959229ce80ad9ec1ce127382570860c00d1;hp=f2506da8941f984341fc8996d2d83acf0911f078;hpb=2fde3badabe2a9707d809d6938d55c93b5651214;p=modeling%2Fetsicatalog.git 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