diff options
author | Erik Botö <erik.boto@pelagicore.com> | 2017-11-06 10:13:06 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-08 22:24:03 +0000 |
commit | c6170c285d2be7a749a9815d7155e74b35d75c2b (patch) | |
tree | 35e67e70f992d49743462fc981d6740d1e4e3c6b /meta/lib/oeqa | |
parent | 98595456729f9ce3c0333cd4907634967dc32530 (diff) | |
download | poky-c6170c285d2be7a749a9815d7155e74b35d75c2b.tar.gz |
sshcontrol.py: in copy_to() always use scp
The current implementation is broken when the localpath is a link.
Then only a symlink would be created on the target, instead of copying
the actual file.
[YOCTO #11524]
(From OE-Core rev: 1eb2a9c2f48d3af13ce651f1adf024b3380299d1)
Signed-off-by: Erik Botö <erik.boto@pelagicore.com>
Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/utils/sshcontrol.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py index 05d6502550..d292893c08 100644 --- a/meta/lib/oeqa/utils/sshcontrol.py +++ b/meta/lib/oeqa/utils/sshcontrol.py | |||
@@ -150,12 +150,9 @@ class SSHControl(object): | |||
150 | 150 | ||
151 | def copy_to(self, localpath, remotepath): | 151 | def copy_to(self, localpath, remotepath): |
152 | if os.path.islink(localpath): | 152 | if os.path.islink(localpath): |
153 | link = os.readlink(localpath) | 153 | localpath = os.path.dirname(localpath) + "/" + os.readlink(localpath) |
154 | dst_dir, dst_base = os.path.split(remotepath) | 154 | command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)] |
155 | return self.run("cd %s; ln -s %s %s" % (dst_dir, link, dst_base)) | 155 | return self._internal_run(command, ignore_status=False) |
156 | else: | ||
157 | command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)] | ||
158 | return self._internal_run(command, ignore_status=False) | ||
159 | 156 | ||
160 | def copy_from(self, remotepath, localpath): | 157 | def copy_from(self, remotepath, localpath): |
161 | command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath] | 158 | command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath] |