Skip to content
Snippets Groups Projects
Commit 280b4375 authored by David Bauer's avatar David Bauer
Browse files

image-customization: simplify return values


If we align the table keys of the selection table to match the return
object of get_selections, we can omit creating a new return object.

Signed-off-by: default avatarDavid Bauer <mail@david-bauer.net>
parent 3152ce6a
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,8 @@ end
local function evaluate_device(env, dev)
local selections = {
feature = {},
package = {},
features = {},
packages = {},
}
local funcs = {}
local device_overrides = {}
......@@ -34,11 +34,11 @@ local function evaluate_device(env, dev)
end
function funcs.features(features)
add_elements('feature', features)
add_elements('features', features)
end
function funcs.packages(packages)
add_elements('package', packages)
add_elements('packages', packages)
end
function funcs.broken(broken)
......@@ -115,12 +115,7 @@ function M.get_selections(env, dev)
end
local eval_result = evaluate_device(env, dev)
return_object = {
features = eval_result.selections['feature'],
packages = eval_result.selections['package'],
}
return return_object
return eval_result.selections
end
function M.device_overrides(env, dev)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment