summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--provisioning-model.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/provisioning-model.lua b/provisioning-model.lua
index 0a86e97..40603c6 100644
--- a/provisioning-model.lua
+++ b/provisioning-model.lua
@@ -2420,9 +2420,12 @@ mymodule.bulk_create_devices = function(self, devicelist)
end
end
if not found then
- -- Check for string match
+ -- Check for string match to label
for k,c in ipairs(class.option) do
- if string.find(c.label, format.escapemagiccharacters(value)) then
+ if c.label == value then
+ found = c.value
+ break
+ elseif string.find(c.label, format.escapemagiccharacters(value)) then
if found then
error("Ambiguous "..name.." class in line "..i)
end
@@ -2461,7 +2464,7 @@ mymodule.bulk_create_devices = function(self, devicelist)
-- Allow the select value to be the value or a unique substring of the label
local found = false
for k,o in ipairs(params.value[class].value[param].option) do
- if values[j] == o.value then
+ if values[j] == o.value or values[j] == o.label then
found = o.value
break
elseif values[j] ~= "" and string.find(o.label, format.escapemagiccharacters(values[j])) then