* [PATCH 1/1] oeqa/utils/commands.py: Fix get_bb_vars() when called without arguments [not found] <cover.1481701176.git.mariano.lopez@linux.intel.com> @ 2016-12-14 7:45 ` mariano.lopez 2016-12-14 16:01 ` Leonardo Sandoval 0 siblings, 1 reply; 4+ messages in thread From: mariano.lopez @ 2016-12-14 7:45 UTC (permalink / raw) To: openembedded-core From: Mariano Lopez <mariano.lopez@linux.intel.com> Commit 9d55e9d489cd78be592fb9b4d6484f9060c62fdd broke calling get_bb_vars() when called without arguments. This fix this issue. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> --- meta/lib/oeqa/utils/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 6acb24a..aecf8cf 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py @@ -149,7 +149,8 @@ def get_bb_vars(variables=None, target=None, postconfig=None): """Get values of multiple bitbake variables""" bbenv = get_bb_env(target, postconfig=postconfig) - variables = variables.copy() + if variables is not None: + variables = variables.copy() var_re = re.compile(r'^(export )?(?P<var>\w+)="(?P<value>.*)"$') unset_re = re.compile(r'^unset (?P<var>\w+)$') lastline = None -- 2.6.6 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] oeqa/utils/commands.py: Fix get_bb_vars() when called without arguments 2016-12-14 7:45 ` [PATCH 1/1] oeqa/utils/commands.py: Fix get_bb_vars() when called without arguments mariano.lopez @ 2016-12-14 16:01 ` Leonardo Sandoval 2016-12-14 16:04 ` Lopez, Mariano 0 siblings, 1 reply; 4+ messages in thread From: Leonardo Sandoval @ 2016-12-14 16:01 UTC (permalink / raw) To: mariano.lopez, openembedded-core On 12/14/2016 01:45 AM, mariano.lopez@linux.intel.com wrote: > From: Mariano Lopez <mariano.lopez@linux.intel.com> > > Commit 9d55e9d489cd78be592fb9b4d6484f9060c62fdd broke calling get_bb_vars() > when called without arguments. This fix this issue. > > Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> > --- > meta/lib/oeqa/utils/commands.py | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py > index 6acb24a..aecf8cf 100644 > --- a/meta/lib/oeqa/utils/commands.py > +++ b/meta/lib/oeqa/utils/commands.py > @@ -149,7 +149,8 @@ def get_bb_vars(variables=None, target=None, postconfig=None): > """Get values of multiple bitbake variables""" > bbenv = get_bb_env(target, postconfig=postconfig) > > - variables = variables.copy() > + if variables is not None: > + variables = variables.copy() Is 'variables' type is a dict (or some derived type)? I see some get_bb_env calls using lists and lists do not have the copy method. > var_re = re.compile(r'^(export )?(?P<var>\w+)="(?P<value>.*)"$') > unset_re = re.compile(r'^unset (?P<var>\w+)$') > lastline = None ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] oeqa/utils/commands.py: Fix get_bb_vars() when called without arguments 2016-12-14 16:01 ` Leonardo Sandoval @ 2016-12-14 16:04 ` Lopez, Mariano 2016-12-14 16:13 ` Leonardo Sandoval 0 siblings, 1 reply; 4+ messages in thread From: Lopez, Mariano @ 2016-12-14 16:04 UTC (permalink / raw) To: Leonardo Sandoval, openembedded-core On 12/14/2016 10:01 AM, Leonardo Sandoval wrote: > > > On 12/14/2016 01:45 AM, mariano.lopez@linux.intel.com wrote: >> From: Mariano Lopez <mariano.lopez@linux.intel.com> >> >> Commit 9d55e9d489cd78be592fb9b4d6484f9060c62fdd broke calling >> get_bb_vars() >> when called without arguments. This fix this issue. >> >> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> >> --- >> meta/lib/oeqa/utils/commands.py | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/meta/lib/oeqa/utils/commands.py >> b/meta/lib/oeqa/utils/commands.py >> index 6acb24a..aecf8cf 100644 >> --- a/meta/lib/oeqa/utils/commands.py >> +++ b/meta/lib/oeqa/utils/commands.py >> @@ -149,7 +149,8 @@ def get_bb_vars(variables=None, target=None, >> postconfig=None): >> """Get values of multiple bitbake variables""" >> bbenv = get_bb_env(target, postconfig=postconfig) >> - variables = variables.copy() >> + if variables is not None: >> + variables = variables.copy() > > Is 'variables' type is a dict (or some derived type)? I see some > get_bb_env calls using lists and lists do not have the copy method. I only see 3 calls in OE core, two of them uses None as first argument, and the last one uses a list, also if you check the function it will handle the argument as a list; so the function expect a list or None. And the list support the copy method, I just double check it: >>> l = [1,2,3] >>> l.copy() [1, 2, 3] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] oeqa/utils/commands.py: Fix get_bb_vars() when called without arguments 2016-12-14 16:04 ` Lopez, Mariano @ 2016-12-14 16:13 ` Leonardo Sandoval 0 siblings, 0 replies; 4+ messages in thread From: Leonardo Sandoval @ 2016-12-14 16:13 UTC (permalink / raw) To: Lopez, Mariano, openembedded-core On 12/14/2016 10:04 AM, Lopez, Mariano wrote: > > > On 12/14/2016 10:01 AM, Leonardo Sandoval wrote: >> >> >> On 12/14/2016 01:45 AM, mariano.lopez@linux.intel.com wrote: >>> From: Mariano Lopez <mariano.lopez@linux.intel.com> >>> >>> Commit 9d55e9d489cd78be592fb9b4d6484f9060c62fdd broke calling >>> get_bb_vars() >>> when called without arguments. This fix this issue. >>> >>> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> >>> --- >>> meta/lib/oeqa/utils/commands.py | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/meta/lib/oeqa/utils/commands.py >>> b/meta/lib/oeqa/utils/commands.py >>> index 6acb24a..aecf8cf 100644 >>> --- a/meta/lib/oeqa/utils/commands.py >>> +++ b/meta/lib/oeqa/utils/commands.py >>> @@ -149,7 +149,8 @@ def get_bb_vars(variables=None, target=None, >>> postconfig=None): >>> """Get values of multiple bitbake variables""" >>> bbenv = get_bb_env(target, postconfig=postconfig) >>> - variables = variables.copy() >>> + if variables is not None: >>> + variables = variables.copy() >> >> Is 'variables' type is a dict (or some derived type)? I see some >> get_bb_env calls using lists and lists do not have the copy method. > > I only see 3 calls in OE core, two of them uses None as first > argument, and the last one uses a list, also if you check the function > it will handle the argument as a list; so the function expect a list > or None. And the list support the copy method, I just double check it: > > >>> l = [1,2,3] > >>> l.copy() > [1, 2, 3] Sorry, I was using the python2 interpreter when I was doing this check. P3 included the copy method on the list data structure. > > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-14 16:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1481701176.git.mariano.lopez@linux.intel.com>
2016-12-14 7:45 ` [PATCH 1/1] oeqa/utils/commands.py: Fix get_bb_vars() when called without arguments mariano.lopez
2016-12-14 16:01 ` Leonardo Sandoval
2016-12-14 16:04 ` Lopez, Mariano
2016-12-14 16:13 ` Leonardo Sandoval
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox