]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/utils/commands: Avoid log message duplication
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 28 Nov 2018 13:00:11 +0000 (13:00 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 1 Dec 2018 11:37:49 +0000 (11:37 +0000)
Each time a runqemu() fails, the log handler would be left behind meaning
messages from any subsequent run would be duplicated (or worse/more).

This ensures we remove the handler regardless and means we no longer
have the duplication.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/commands.py

index e6a35d3d259f24049e7d0be8193da2c8487e0a47..2e6a2289cd988a78ee4c77171d136ce42ad35a1e 100644 (file)
@@ -345,11 +345,11 @@ def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None,
         yield qemu
 
     finally:
+        targetlogger.removeHandler(handler)
         try:
             qemu.stop()
         except:
             pass
-    targetlogger.removeHandler(handler)
 
 def updateEnv(env_file):
     """