From f467fd277eb77336097cfc0f5f329bdc8d0f70cb Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Thu, 19 Jul 2018 13:47:18 +0800 Subject: logging: use warning instead warn The warn method is deprecated. We should use the documented warning instead. Quoting from the python's official doc: """ Note: There is an obsolete method warn which is functionally identical to warning. As warn is deprecated, please do not use it - use warning instead. """ Signed-off-by: Chen Qi Signed-off-by: Ross Burton --- meta/lib/oe/terminal.py | 6 +++--- meta/lib/oeqa/selftest/context.py | 2 +- meta/lib/oeqa/utils/qemurunner.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'meta') diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 94afe394ed..caeb5e31ec 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py @@ -112,7 +112,7 @@ class Screen(Terminal): bb.event.fire(bb.event.LogExecTTY(msg, "screen -r %s" % s_id, 0.5, 10), d) else: - logger.warn(msg) + logger.warning(msg) class TmuxRunning(Terminal): """Open a new pane in the current running tmux window""" @@ -168,7 +168,7 @@ class Tmux(Terminal): if d: bb.event.fire(bb.event.LogExecTTY(msg, attach_cmd, 0.5, 10), d) else: - logger.warn(msg) + logger.warning(msg) class Custom(Terminal): command = 'false' # This is a placeholder @@ -180,7 +180,7 @@ class Custom(Terminal): if not '{command}' in self.command: self.command += ' {command}' Terminal.__init__(self, sh_cmd, title, env, d) - logger.warn('Custom terminal was started.') + logger.warning('Custom terminal was started.') else: logger.debug(1, 'No custom terminal (OE_TERMINAL_CUSTOMCMD) set') raise UnsupportedTerminal('OE_TERMINAL_CUSTOMCMD not set') diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index c937b8171c..16812ba96e 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py @@ -156,7 +156,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor): os.chdir(builddir) if not "meta-selftest" in self.tc.td["BBLAYERS"]: - self.tc.logger.warn("meta-selftest layer not found in BBLAYERS, adding it") + self.tc.logger.warning("meta-selftest layer not found in BBLAYERS, adding it") meta_selftestdir = os.path.join( self.tc.td["BBLAYERS_FETCH_DIR"], 'meta-selftest') if os.path.isdir(meta_selftestdir): diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index c962602a63..c8bd6516cf 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -384,7 +384,7 @@ class QemuRunner: # qemu-system behaves well and a SIGTERM is enough os.kill(self.qemupid, signal.SIGTERM) except ProcessLookupError as e: - self.logger.warn('qemu-system ended unexpectedly') + self.logger.warning('qemu-system ended unexpectedly') def stop_thread(self): if self.thread and self.thread.is_alive(): @@ -461,7 +461,7 @@ class QemuRunner: def _dump_host(self): self.host_dumper.create_dir("qemu") - self.logger.warn("Qemu ended unexpectedly, dump data from host" + self.logger.warning("Qemu ended unexpectedly, dump data from host" " is in %s" % self.host_dumper.dump_dir) self.host_dumper.dump_host() -- cgit 1.2.3-korg