From 12c8d505c49b8b999660c52872a66071a9abc4c6 Mon Sep 17 00:00:00 2001 From: Alex Shatov Date: Tue, 5 Feb 2019 13:03:53 -0500 Subject: 3.2.0/5.2.0 - fixed zip folder bug by admzip lib - external version 3.2.0 - internal version 5.2.0 for code change - no API change - fixed the zip folder bug when sending the blueprint to cloudify = this bug was preventing the opening of the blueprint in cloudify UI because the folder record was not properly formatted by admzip lib 0.4.7 - upgraded adm-zip lib to the latest version 0.4.13 - unit tested the zipping of the blueprint file under subfolder without having the subfolder record in zip = manual unzip in linux shows proper subfolder/file structure = automatic unzip is not supported by the old ubuntu = would need upgrading the node.js/ubuntu and installing unzip for proper testing - see code comments in unit-test - zip file created by admzip unzips properly both in linux and in Windows = zip still has some header warnings, but not critical unit test coverage summary Statements : 80.94% ( 943/1165 ) Branches : 58.22% ( 294/505 ) Functions : 81.28% ( 165/203 ) Lines : 81.48% ( 933/1145 ) Change-Id: I48e44f025c21ef51de5a7422c8db9433581c787f Signed-off-by: Alex Shatov Issue-ID: DCAEGEN2-855 --- Dockerfile_UT | 3 ++- LICENSE.txt | 2 +- deployment-handler.js | 4 +--- lib/cloudify.js | 5 ++-- package.json | 4 ++-- pom.xml | 4 ++-- tests/mock_deployment_handler.js | 8 +++++-- tests/test_dcae-deployments.js | 51 +++++++++++++++++++++++++--------------- tests/test_policy.js | 7 +++--- version.properties | 2 +- 10 files changed, 52 insertions(+), 38 deletions(-) diff --git a/Dockerfile_UT b/Dockerfile_UT index e6a6509..27b84ba 100644 --- a/Dockerfile_UT +++ b/Dockerfile_UT @@ -6,7 +6,8 @@ ENV APPDIR ${INSROOT}/${APPUSER} WORKDIR ${APPDIR} -RUN mkdir -p ${APPDIR}/lib \ +RUN uname -a \ + && mkdir -p ${APPDIR}/lib \ && mkdir -p ${APPDIR}/tests \ && mkdir -p ${APPDIR}/etc \ && mkdir -p ${APPDIR}/log \ diff --git a/LICENSE.txt b/LICENSE.txt index 14cb17c..c142ce1 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,7 +1,7 @@ /* * ============LICENSE_START========================================== * =================================================================== -* Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +* Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed diff --git a/deployment-handler.js b/deployment-handler.js index edbf84e..26074e7 100644 --- a/deployment-handler.js +++ b/deployment-handler.js @@ -1,5 +1,5 @@ /* -Copyright(c) 2017-2018 AT&T Intellectual Property. All rights reserved. +Copyright(c) 2017-2019 AT&T Intellectual Property. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,8 +20,6 @@ See the License for the specific language governing permissions and limitations const API_VERSION = "5.0.0"; -const fs = require('fs'); -const util = require('util'); const http = require('http'); const https = require('https'); const express = require('express'); diff --git a/lib/cloudify.js b/lib/cloudify.js index 138b986..1cd5489 100644 --- a/lib/cloudify.js +++ b/lib/cloudify.js @@ -1,5 +1,5 @@ /* -Copyright(c) 2017-2018 AT&T Intellectual Property. All rights reserved. +Copyright(c) 2017-2019 AT&T Intellectual Property. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -231,8 +231,7 @@ exports.uploadBlueprint = function(req, bpid, blueprint) { // Cloudify API wants a gzipped tar of a directory, not the blueprint text const zip = new admzip(); - zip.addFile('work/', new Buffer(0)); - zip.addFile('work/blueprint.yaml', new Buffer(blueprint, 'utf8')); + zip.addFile('work/blueprint.yaml', Buffer.from(blueprint, 'utf8')); const zip_buffer = zip.toBuffer(); // Set up the HTTP PUT request diff --git a/package.json b/package.json index 2c5f677..9f24b9f 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "onap-dcae-deployment-handler", - "version": "5.1.0", + "version": "5.2.0", "description": "ONAP DCAE Deployment Handler", "main": "deployment-handler.js", "dependencies": { - "adm-zip": "0.4.7", + "adm-zip": "0.4.13", "body-parser": "^1.15.0", "express": "^4.13.4", "log4js": "^0.6.33", diff --git a/pom.xml b/pom.xml index 6c2dcca..bf15408 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@