avocado.plugins.docker: Warn on cleanup failures

The docker cleanup can sometimes fail, which masks the original failure.
This patch catches all exceptions and only log them to UI as warnings.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 9b8732de
......@@ -141,10 +141,13 @@ class DockerTestRunner(RemoteTestRunner):
self.job.args.remote_no_copy = self.job.args.docker_no_copy
def tear_down(self):
if self.remote:
self.remote.close()
if not self.job.args.docker_no_cleanup:
self.remote.cleanup()
try:
if self.remote:
self.remote.close()
if not self.job.args.docker_no_cleanup:
self.remote.cleanup()
except Exception as details:
self.job.log.warn("DOCKER : Fail to cleanup: %s" % details)
class Docker(CLI):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册