diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2023-09-25 04:18:31 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-26 10:37:17 +0100 |
commit | c7f99d688cd62b9bdfb1724368b96200e98f0426 (patch) | |
tree | 83afcb0862c0ee8edb095bd2156e010886aa1744 /bitbake | |
parent | e0494a64f181f6112565172c8e2d06f6099153cf (diff) | |
download | poky-c7f99d688cd62b9bdfb1724368b96200e98f0426.tar.gz |
bitbake: tinfoil: Do not fail when logging is disabled and full config is used
If Tinfoil is initialized with setup_logging = False and
Tinfoil.prepare() is called with config_only = False, then it fails
because self.localhandlers is only initialized when
setup_logging = True.
This is seen with, e.g., `bitbake-getvar -q -r busybox MACHINE`:
Traceback (most recent call last):
File ".../bitbake/bin/bitbake-getvar", line 41, in <module>
tinfoil.prepare(quiet=2)
File ".../bitbake/lib/bb/tinfoil.py", line 390, in prepare
for handler in self.localhandlers:
AttributeError: 'Tinfoil' object has no attribute 'localhandlers'.
Did you mean: 'oldhandlers'?
(Bitbake rev: 616101ddb630e2c9975022068b52a87c4cf647f6)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/tinfoil.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index 2200caa54c..dcd3910cc4 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
@@ -325,11 +325,11 @@ class Tinfoil: | |||
325 | self.recipes_parsed = False | 325 | self.recipes_parsed = False |
326 | self.quiet = 0 | 326 | self.quiet = 0 |
327 | self.oldhandlers = self.logger.handlers[:] | 327 | self.oldhandlers = self.logger.handlers[:] |
328 | self.localhandlers = [] | ||
328 | if setup_logging: | 329 | if setup_logging: |
329 | # This is the *client-side* logger, nothing to do with | 330 | # This is the *client-side* logger, nothing to do with |
330 | # logging messages from the server | 331 | # logging messages from the server |
331 | bb.msg.logger_create('BitBake', output) | 332 | bb.msg.logger_create('BitBake', output) |
332 | self.localhandlers = [] | ||
333 | for handler in self.logger.handlers: | 333 | for handler in self.logger.handlers: |
334 | if handler not in self.oldhandlers: | 334 | if handler not in self.oldhandlers: |
335 | self.localhandlers.append(handler) | 335 | self.localhandlers.append(handler) |