]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/commands: don't break if get_bb_vars is passed a tuple
authorRoss Burton <ross.burton@intel.com>
Wed, 22 Nov 2017 15:56:54 +0000 (15:56 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 2 Dec 2017 11:24:35 +0000 (11:24 +0000)
get_bb_vars was using variables.copy() to duplicate the list of variables passed
but this function only exists in lists [1,2] and not tuples (1,2).

Instead of throwing an exception if the variables are in a tuple, simply
construct a new list using the passed sequence-like object.

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/utils/commands.py

index 0bb90028dc63a75e84c8bc7ee364ca2bf1a62c35..cad0bea0be98ca1130412f202052e04e6e67c780 100644 (file)
@@ -227,7 +227,7 @@ def get_bb_vars(variables=None, target=None, postconfig=None):
     bbenv = get_bb_env(target, postconfig=postconfig)
 
     if variables is not None:
-        variables = variables.copy()
+        variables = list(variables)
     var_re = re.compile(r'^(export )?(?P<var>\w+(_.*)?)="(?P<value>.*)"$')
     unset_re = re.compile(r'^unset (?P<var>\w+)$')
     lastline = None