aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-bdd/stepDefinitions/Utils.js
diff options
context:
space:
mode:
authorilanap <ilanap@amdocs.com>2018-02-19 10:36:26 +0200
committerilanap <ilanap@amdocs.com>2018-02-19 13:48:50 +0200
commitbd76c092d9929aa69682767855ba47b1ccc627d8 (patch)
tree57c7321e1fc8aeaaa6d6ea7214ca236c2a5b161e /openecomp-bdd/stepDefinitions/Utils.js
parent3437fc9044b05d53d20c2d5ca0cb5b0705bff155 (diff)
Fix for adding BDD prefixes for for download
Change-Id: Id796408470330300f79120ba5d39987989aff206 Issue-ID: SDC-990 Signed-off-by: ilanap <ilanap@amdocs.com>
Diffstat (limited to 'openecomp-bdd/stepDefinitions/Utils.js')
-rw-r--r--openecomp-bdd/stepDefinitions/Utils.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/openecomp-bdd/stepDefinitions/Utils.js b/openecomp-bdd/stepDefinitions/Utils.js
index 08d0a2b10f..4a54ebe3a7 100644
--- a/openecomp-bdd/stepDefinitions/Utils.js
+++ b/openecomp-bdd/stepDefinitions/Utils.js
@@ -17,8 +17,8 @@ const request = require('request');
const fs = require('fs');
require('node-zip');
-function _request(context, method, path, data, isBinary=false, prefix='onboarding') {
- let server = context.server + '/' + context.prefix[prefix];
+function _request(context, method, path, data, isBinary=false, type='onboarding') {
+ let server = context.getUrlForType(type);
let options = {
method: method,
@@ -99,13 +99,14 @@ function _request(context, method, path, data, isBinary=false, prefix='onboardin
});
}
-function download(context, path, filePath, callback){
- let options = {
+function download(context, path, filePath, callback, type='onboarding') {
+ let server = context.getUrlForType(type);
+ let options = {
method: 'GET',
- url: context.onboarding_server + path,
+ url: server + path,
headers: context.headers
};
- var file = fs.createWriteStream(filePath);
+ var file = fs.createWriteStream(filePath);
var r = request(options).pipe(file);
r.on('error', function (err) {
console.log(err);