summaryrefslogtreecommitdiffstats
path: root/vnftest/steps/rest_call.py
diff options
context:
space:
mode:
authorMoshe <moshehoa@amdocs.com>2019-01-10 14:22:43 +0200
committerMoshe <moshehoa@amdocs.com>2019-01-10 14:22:50 +0200
commit1112c6e3e6eae3aa10680b2d7b0d653de1a4bc0b (patch)
treebca2c48047f1d525934324f2adb9d4920194b908 /vnftest/steps/rest_call.py
parentce6df7403af5694aee412836cd3c86e33307e190 (diff)
allow use of logical path for resources
Issue-ID: VNFSDK-350 Change-Id: I75a95412e4029389b2f1b39236339873a77db24e Signed-off-by: Moshe <moshehoa@amdocs.com>
Diffstat (limited to 'vnftest/steps/rest_call.py')
-rw-r--r--vnftest/steps/rest_call.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/vnftest/steps/rest_call.py b/vnftest/steps/rest_call.py
index 7b034ec..3dde6f4 100644
--- a/vnftest/steps/rest_call.py
+++ b/vnftest/steps/rest_call.py
@@ -122,8 +122,9 @@ class RestCall(base.Step):
if 'file' in operation:
file_conf = operation['file']
LOG.info(file_conf)
- files = {file_conf['key']: open(file_conf['path'])}
- result = rest_client.upload_file(url, headers, files, LOG)
+ with utils.load_resource(file_conf['path']) as stream:
+ files = {file_conf['key']: stream}
+ result = rest_client.upload_file(url, headers, files, LOG)
else:
result = rest_client.call(url,
operation['method'],