[oe-commits] [openembedded-core] 01/06: qemurunner: Ensure logging handler is removed

git at git.openembedded.org git at git.openembedded.org
Wed Nov 8 22:36:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

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

commit 92e884c79df197a4a5466ee1fad2f83a42bb92ee
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Nov 7 23:23:54 2017 +0000

    qemurunner: Ensure logging handler is removed
    
    If we don't remove the handler we end up with duplicate log messages
    which is undesireable.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/utils/qemurunner.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 72f05d5..aa2600b 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -58,7 +58,8 @@ class QemuRunner:
         self.host_dumper = HostDumper(dump_host_cmds, dump_dir)
 
         self.logger = logging.getLogger("BitBake.QemuRunner")
-        self.logger.addHandler(logging.StreamHandler(sys.stdout))
+        self.handler = logging.StreamHandler(sys.stdout)
+        self.logger.addHandler(self.handler)
 
     def create_socket(self):
         try:
@@ -370,6 +371,7 @@ class QemuRunner:
         self.ip = None
         if os.path.exists(self.qemu_pidfile):
             os.remove(self.qemu_pidfile)
+        self.logger.removeHandler(self.handler)
 
     def stop_qemu_system(self):
         if self.qemupid:

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


More information about the Openembedded-commits mailing list