diff options
author | Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> | 2017-06-28 09:59:18 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-21 22:51:37 +0100 |
commit | 5778e35378dfa76958239f9a0ecb71ed90c16225 (patch) | |
tree | a93ca58b60c7961a9c0578fb176cca59b5e859a9 | |
parent | 2c035b266f7a7f904afa7698706eba1361b41411 (diff) | |
download | poky-5778e35378dfa76958239f9a0ecb71ed90c16225.tar.gz |
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>
-rw-r--r-- | scripts/lib/devtool/utilcmds.py | 2 | ||||
-rw-r--r-- | scripts/lib/recipetool/newappend.py | 2 | ||||
-rw-r--r-- | scripts/lib/scriptutils.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/scripts/lib/devtool/utilcmds.py b/scripts/lib/devtool/utilcmds.py index 0437e6417c..938d88afc0 100644 --- a/scripts/lib/devtool/utilcmds.py +++ b/scripts/lib/devtool/utilcmds.py | |||
@@ -49,7 +49,7 @@ def edit_recipe(args, config, basepath, workspace): | |||
49 | raise DevtoolError("Recipe file for %s is not under the workspace" % | 49 | raise DevtoolError("Recipe file for %s is not under the workspace" % |
50 | args.recipename) | 50 | args.recipename) |
51 | 51 | ||
52 | return scriptutils.run_editor(recipefile) | 52 | return scriptutils.run_editor(recipefile, logger) |
53 | 53 | ||
54 | 54 | ||
55 | def configure_help(args, config, basepath, workspace): | 55 | def configure_help(args, config, basepath, workspace): |
diff --git a/scripts/lib/recipetool/newappend.py b/scripts/lib/recipetool/newappend.py index 0b63759d8c..decce83fac 100644 --- a/scripts/lib/recipetool/newappend.py +++ b/scripts/lib/recipetool/newappend.py | |||
@@ -74,7 +74,7 @@ def newappend(args): | |||
74 | return 1 | 74 | return 1 |
75 | 75 | ||
76 | if args.edit: | 76 | if args.edit: |
77 | return scriptutils.run_editor([append_path, recipe_path]) | 77 | return scriptutils.run_editor([append_path, recipe_path], logger) |
78 | else: | 78 | else: |
79 | print(append_path) | 79 | print(append_path) |
80 | 80 | ||
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py index b6217dc059..97854385d5 100644 --- a/scripts/lib/scriptutils.py +++ b/scripts/lib/scriptutils.py | |||
@@ -205,7 +205,7 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False): | |||
205 | return checksums, tmpdir | 205 | return checksums, tmpdir |
206 | 206 | ||
207 | 207 | ||
208 | def run_editor(fn): | 208 | def run_editor(fn, logger=None): |
209 | if isinstance(fn, str): | 209 | if isinstance(fn, str): |
210 | params = '"%s"' % fn | 210 | params = '"%s"' % fn |
211 | else: | 211 | else: |