nvs_util: Add check for keylen in input csv
This commit is contained in:
parent
cbec031c91
commit
23c17c4c0d
1 changed files with 2 additions and 0 deletions
|
@ -755,6 +755,8 @@ def nvs_part_gen(input_filename=None, output_filename=None, input_part_size=None
|
||||||
reader = csv.DictReader(input_file, delimiter=',')
|
reader = csv.DictReader(input_file, delimiter=',')
|
||||||
for row in reader:
|
for row in reader:
|
||||||
try:
|
try:
|
||||||
|
if len(row["key"]) > 15:
|
||||||
|
raise InputError("Error: Length of key `%s` should be <= 15 characters." % row["key"])
|
||||||
write_entry(nvs_obj, row["key"], row["type"], row["encoding"], row["value"])
|
write_entry(nvs_obj, row["key"], row["type"], row["encoding"], row["value"])
|
||||||
except (InputError) as e:
|
except (InputError) as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
Loading…
Reference in a new issue