From: Lucian Musat Date: Mon, 28 Sep 2015 14:25:56 +0000 (+0300) Subject: oeqa/runexported: Fix a problem with ssh_target_log existing in folder. X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~28722 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bc7732c27e192821b9ebb76e1dfba739cf5b088;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oeqa/runexported: Fix a problem with ssh_target_log existing in folder. 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 Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/runexported.py b/meta/lib/oeqa/runexported.py index 4213cab7bc0..0daedd057e5 100755 --- a/meta/lib/oeqa/runexported.py +++ b/meta/lib/oeqa/runexported.py @@ -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)