If controller is executed outside of LNST source directory the generated
tarball contains content of current working directory instead of the LNST
code. The fix is to change the current directory using -C tar option and
use of ./ instead of * wildcard.
---
Common/SlaveUtils.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Common/SlaveUtils.py b/Common/SlaveUtils.py
index e7fdf3d..3640f94 100644
--- a/Common/SlaveUtils.py
+++ b/Common/SlaveUtils.py
@@ -8,7 +8,7 @@ jzupka(a)redhat.com (Jiri Zupka)
from Common.SshUtils import scp_to_remote, wait_for_login
from Common.ShellProcess import ShellProcess
-
+import sys
def prepare_client_session(host, port, login, passwd=None, command=None,
prompt=None, install_path=None, test_dir=None):
@@ -26,7 +26,8 @@ def prepare_client_session(host, port, login, passwd=None, command=None,
install_path = "/tmp"
if test_dir is None:
test_dir = "lnst"
- s = ShellProcess("tar -cjf lnst.tar.bz2 --exclude *.pyc --exclude 'Logs/*' *")
+
+ s = ShellProcess("tar -cjf lnst.tar.bz2 --exclude *.pyc --exclude 'Logs/*' -C '%s' ./" % sys.path[0])
s.wait()
scp_to_remote(host, port, login, passwd,
"lnst.tar.bz2","/%s/" % (install_path))
@@ -39,4 +40,4 @@ def prepare_client_session(host, port, login, passwd=None, command=None,
prompt = "Started"
command = "cd /%s/%s/ && ./%s" % (install_path, test_dir, command)
return wait_for_login(host, port, login, passwd, prompt,
- command=command, timeout=10)
\ No newline at end of file
+ command=command, timeout=10)
--
1.7.6.5