Merge branch 'fix/nvs_util_keylen_3.2' into 'release/v3.2'

nvs_util: Add check for keylen in input csv (v3.2)

See merge request espressif/esp-idf!5396
This commit is contained in:
Angus Gratton 2019-07-08 12:59:55 +08:00
commit a8916daeb2

View File

@ -755,6 +755,8 @@ def nvs_part_gen(input_filename=None, output_filename=None, input_part_size=None
reader = csv.DictReader(input_file, delimiter=',')
for row in reader:
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"])
except (InputError) as e:
print(e)