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 19:54:23 +0000 |
commit | 1eb2a9c2f48d3af13ce651f1adf024b3380299d1 (patch) | |
tree | d5510105c7f8f391e372094e65026f3abc21697d | |
parent | 64614ab6894143fa4876558cbe3d2954e5b08eac (diff) | |
download | openembedded-core-1eb2a9c2f48d3af13ce651f1adf024b3380299d1.tar.gz openembedded-core-1eb2a9c2f48d3af13ce651f1adf024b3380299d1.tar.bz2 openembedded-core-1eb2a9c2f48d3af13ce651f1adf024b3380299d1.zip |
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]
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>
-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): def copy_to(self, localpath, remotepath): if os.path.islink(localpath): - link = os.readlink(localpath) - dst_dir, dst_base = os.path.split(remotepath) - return self.run("cd %s; ln -s %s %s" % (dst_dir, link, dst_base)) - else: - command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)] - return self._internal_run(command, ignore_status=False) + localpath = os.path.dirname(localpath) + "/" + os.readlink(localpath) + command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)] + return self._internal_run(command, ignore_status=False) def copy_from(self, remotepath, localpath): command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath] |