iot-lab / cli-tools

IoT-LAB CLI tools
Other
17 stars 14 forks source link

Files duplicate basenames #36

Closed rienafairefr closed 5 years ago

rienafairefr commented 5 years ago

As discussed this morning.

The heart of the matter is iotlabcli.helpers.FilesDict which is the class responsible for storing experiment files before they are shipped off in multipart. It couldn't handle two different files with the same basename because the indexing key is the basename and it errors when modifying an element to a different value.

I've modified the add_file method to be able to handle duplicated basenames with different content, modifying the file name to prepend the MD5 hash. I've modified add_files_from_dict so that this method modifies the input files_dict (containing the association between nodes and firmwares, etc), that might be considered a feature (we can thus e.g. print the submission with the modified firmware names in it before being sent).

In the process, I've migrated that part to pytest (doctests included), I should probably make that ( 47551ee) a fully separate commit

fsaintma commented 5 years ago

@cladmi should you review this PR and say us if is it ok for you ? After we will merge and publish a new cli-tools version and deploy it on testbed. Thanks

rienafairefr commented 5 years ago

@cladmi I've cleaned up the commits taking into account your comments. Can you test if it work to handle firmwares with the same basenames on your side ? Thanks

cladmi commented 5 years ago

I lost on this one, I put it on my tomorrow plans.