mirror of
https://git.yoctoproject.org/git/poky
synced 2026-01-04 16:10:04 +00:00
scriptutils: pass in logger as parameter
logger was not defined in scriptutils.py based on the
observation in python traceback.
Traceback (most recent call last):
File "/workdir/poky/scripts/devtool", line 351, in <module>
ret = main()
File "/workdir/poky/scripts/devtool", line 338, in main
ret = args.func(args, config, basepath, workspace)
File "/workdir/poky/scripts/lib/devtool/utilcmds.py", line 55, in
edit_recipe
return scriptutils.run_editor(find_recipe(args, config, basepath,
workspace))
File "/workdir/poky/scripts/lib/scriptutils.py", line 141, in
run_editor
logger.error("Execution of '%s' failed: %s" % (editor, exc))
NameError: name 'logger' is not defined
We pass in logger as parameter to run_editor() from where it has
been called (devtool/utilcmds.py and recipetool/newappend.py),
which both modules already has logger setup.
(From OE-Core rev: 21f04b61973dd9029f0e6bff5445e31cd762bf32)
Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
2c035b266f
commit
5778e35378
|
|
@ -49,7 +49,7 @@ def edit_recipe(args, config, basepath, workspace):
|
|||
raise DevtoolError("Recipe file for %s is not under the workspace" %
|
||||
args.recipename)
|
||||
|
||||
return scriptutils.run_editor(recipefile)
|
||||
return scriptutils.run_editor(recipefile, logger)
|
||||
|
||||
|
||||
def configure_help(args, config, basepath, workspace):
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ def newappend(args):
|
|||
return 1
|
||||
|
||||
if args.edit:
|
||||
return scriptutils.run_editor([append_path, recipe_path])
|
||||
return scriptutils.run_editor([append_path, recipe_path], logger)
|
||||
else:
|
||||
print(append_path)
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False):
|
|||
return checksums, tmpdir
|
||||
|
||||
|
||||
def run_editor(fn):
|
||||
def run_editor(fn, logger=None):
|
||||
if isinstance(fn, str):
|
||||
params = '"%s"' % fn
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user