1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-27 07:27:12 +00:00

wic: partition: simlify calling plugin methods

Replaced parse_sourceparams function with list comprehension.
Used local variables instead of attributes.
Moved global variable to the local scope.

[YOCTO #10619]

(From OE-Core rev: 4adbac84046ff744f1452b5ff4d017d17d2d45e2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2017-01-31 12:37:45 +02:00
committed by Richard Purdie
parent d8a89baffb
commit 08217a4c80
2 changed files with 25 additions and 51 deletions
-23
View File
@@ -222,26 +222,3 @@ def get_bitbake_var(var, image=None, cache=True):
get_var method of BB_VARS singleton.
"""
return BB_VARS.get_var(var, image, cache)
def parse_sourceparams(sourceparams):
"""
Split sourceparams string of the form key1=val1[,key2=val2,...]
into a dict. Also accepts valueless keys i.e. without =.
Returns dict of param key/val pairs (note that val may be None).
"""
params_dict = {}
params = sourceparams.split(',')
if params:
for par in params:
if not par:
continue
if not '=' in par:
key = par
val = None
else:
key, val = par.split('=')
params_dict[key] = val
return params_dict