diff options
author | vamahaja <vamahaja@redhat.com> | 2020-03-24 17:04:42 +0530 |
---|---|---|
committer | Vaibhav Mahajan <vamahaja@redhat.com> | 2020-03-26 06:17:08 +0000 |
commit | 1b93f719566bdaad263d4e6e5ed107c7311541c9 (patch) | |
tree | 20cf750622574b3ff9b24d5c4ec592b788be3c71 /tests/functional | |
parent | c697befe2b21543186b24b1092b79ddcd6a60273 (diff) |
[LibFix] Fix 'g.rpyc_get_connection' library issue
'g.rpyc_get_connection' library fails to set connection. Instead of
using 'g.rpyc_get_connection' libray for modifying file remotely,
create file locally and upload to remote location using 'g.upload'
library.
Change-Id: I85564ee5b7c28a9d866be033d18bd018f648cd5b
Signed-off-by: vamahaja <vamahaja@redhat.com>
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/heketi/test_volume_multi_req.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/functional/heketi/test_volume_multi_req.py b/tests/functional/heketi/test_volume_multi_req.py index 0c1b42ac..3fdc4381 100644 --- a/tests/functional/heketi/test_volume_multi_req.py +++ b/tests/functional/heketi/test_volume_multi_req.py @@ -3,6 +3,7 @@ import contextlib import random +import tempfile import threading import time @@ -94,15 +95,12 @@ def temp_config(ocp_node, cfg): Returns: str: A path to a temporary file. """ - conn = g.rpyc_get_connection(ocp_node, user="root") - tmp = conn.modules.tempfile.NamedTemporaryFile() - try: - tmp.write(yaml.safe_dump(cfg)) + with tempfile.NamedTemporaryFile() as tmp: + tmp.write(yaml.safe_dump(cfg).encode()) tmp.flush() filename = tmp.name + g.upload(ocp_node, filename, filename) yield filename - finally: - tmp.close() def wait_for_claim(ocp_node, pvc_name, timeout=60, interval=2): |