Use os.path.join to form the cli command
* If cli_dir path has no trailing "/" the generated command would no
longer be malformed
* Fix tempest.conf.sample: CLI group should not be capitalized
Change-Id: I4d367d4b6cde492ceb224c4b644d4853181a62ce
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index db6a7bd..bc191d8 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -332,8 +332,8 @@
# ssh username for the image file
ssh_user = cirros
-[CLI]
+[cli]
# Enable cli tests
enabled = True
# directory where python client binaries are located
-cli_dir = /usr/local/bin/
+cli_dir = /usr/local/bin
diff --git a/tempest/cli/__init__.py b/tempest/cli/__init__.py
index 413990d..75267cf 100644
--- a/tempest/cli/__init__.py
+++ b/tempest/cli/__init__.py
@@ -16,6 +16,7 @@
# under the License.
import logging
+import os
import shlex
import subprocess
@@ -99,7 +100,7 @@
def cmd(self, cmd, action, flags='', params='', fail_ok=False,
merge_stderr=False):
"""Executes specified command for the given action."""
- cmd = ' '.join([CONF.cli.cli_dir + cmd,
+ cmd = ' '.join([os.path.join(CONF.cli.cli_dir, cmd),
flags, action, params])
LOG.info("running: '%s'" % cmd)
cmd = shlex.split(cmd)