[oe-commits] [openembedded-core] 22/44: oeqa/utils/sshcontrol.py: Allows to copy symlinks to target

git at git.openembedded.org git at git.openembedded.org
Wed Aug 3 12:01:23 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 838442a42be4952a1a45d99f903730d51f7a1e64
Author: Mariano Lopez <mariano.lopez at linux.intel.com>
AuthorDate: Tue Jul 26 09:38:57 2016 +0000

    oeqa/utils/sshcontrol.py: Allows to copy symlinks to target
    
    Currently when copying a symlink to the target it will fail
    throwing an exception. This will recreate symlinks from the
    system performing the tests to the device under tests.
    
    [YOCTO #9932]
    
    Signed-off-by: Mariano Lopez <mariano.lopez at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oeqa/utils/sshcontrol.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
index f5d46e0..da485ee 100644
--- a/meta/lib/oeqa/utils/sshcontrol.py
+++ b/meta/lib/oeqa/utils/sshcontrol.py
@@ -147,8 +147,13 @@ class SSHControl(object):
         return self._internal_run(command, timeout, self.ignore_status)
 
     def copy_to(self, localpath, remotepath):
-        command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
-        return self._internal_run(command, ignore_status=False)
+        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)
 
     def copy_from(self, remotepath, localpath):
         command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath]

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list