]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runexported: Fix a problem with ssh_target_log existing in folder.
authorLucian Musat <george.l.musat@intel.com>
Mon, 28 Sep 2015 14:25:56 +0000 (17:25 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Sep 2015 14:15:48 +0000 (15:15 +0100)
When copying the exported tests to a remote machine ssh_target_log can
be transformed from softlink to file which will throw an error when
trying to run again.

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runexported.py

index 4213cab7bc0f2e77737e6581996fe9c5e4297ef0..0daedd057e5dda113efab291401a4416bdd6f63c 100755 (executable)
@@ -49,8 +49,8 @@ class FakeTarget(object):
     def exportStart(self):
         self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
         sshloglink = os.path.join(self.testdir, "ssh_target_log")
-        if os.path.islink(sshloglink):
-            os.unlink(sshloglink)
+        if os.path.exists(sshloglink):
+            os.remove(sshloglink)
         os.symlink(self.sshlog, sshloglink)
         print("SSH log file: %s" %  self.sshlog)
         self.connection = SSHControl(self.ip, logfile=self.sshlog)