aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/network_services/utils.py')
-rw-r--r--yardstick/network_services/utils.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/yardstick/network_services/utils.py b/yardstick/network_services/utils.py
index cb71a6029..38fbda47f 100644
--- a/yardstick/network_services/utils.py
+++ b/yardstick/network_services/utils.py
@@ -45,17 +45,19 @@ def get_nsb_option(option, default=None):
return default
-def provision_tool(connection, tool_path):
+def provision_tool(connection, tool_path, tool_file=None):
"""
verify if the tool path exits on the node,
if not push the local binary to remote node
:return - Tool path
"""
+ if tool_file:
+ tool_path = os.path.join(tool_path, tool_file)
bin_path = get_nsb_option("bin_path")
- exit_status, stdout = connection.execute("which %s" % tool_path)[:2]
+ exit_status, stdout = connection.execute("which %s > /dev/null 2>&1" % tool_path)[:2]
if exit_status == 0:
- return encodeutils.safe_decode(stdout, incoming='utf-8').rstrip()
+ return encodeutils.safe_decode(tool_path, incoming='utf-8').rstrip()
logging.warning("%s not found on %s, will try to copy from localhost",
tool_path, connection.host)