autotest: strip whitespace from parameter attribute values

Attempt to fix \r\n issue on Azure cygwin tests
This commit is contained in:
Peter Barker 2020-02-21 11:13:37 +11:00 committed by Peter Barker
parent 1c77df9169
commit 293692cc24

View File

@ -131,7 +131,7 @@ for vehicle in vehicles:
for field in fields:
field_list.append(field[0])
if field[0] in known_param_fields:
value = re.sub('@PREFIX@', "", field[1])
value = re.sub('@PREFIX@', "", field[1]).rstrip()
setattr(p, field[0], value)
else:
error("param: unknown parameter metadata field '%s'" % field[0])
@ -285,7 +285,8 @@ def validate(param):
if (hasattr(param, "Range")):
rangeValues = param.__dict__["Range"].split(" ")
if (len(rangeValues) != 2):
error("Invalid Range values for %s" % (param.name))
error("Invalid Range values for %s (%s)" %
(param.name, param.__dict__["Range"]))
return
min_value = rangeValues[0]
max_value = rangeValues[1]