Open JordiMForgeFlow opened 5 months ago
@sebalix can you review this pls?
Probably fixed by https://github.com/OCA/edi-framework/pull/65 ?
This PR doesn't address the same thing, I do not know enough about this EDI module but what I did in my PR is the replacement of fs_storage
deprecated methods.
Now I cannot say if find_files
should return relative or full paths... :man_shrugging:
@JordiMForgeFlow maybe we should include your fix in my PR (or on top of it)? Basically I moved the deprecated functions of fs_storage
inside edi_storage_oca
(I do not know the story, why such methods are deprecated, but we'll probably copy such convenient methods here and there, cc @simahawk )
@sebalix works for me. Should I wait until your PR gets merged or do you want to apply the commit to your PR?
@sebalix ping
BTW I've just got another weird issue on list files https://github.com/OCA/edi-framework/pull/76
Hello @JordiMForgeFlow
_storage_get_input_filenames
is supposed to return file names, not paths_storage_create_record_if_missing
jobs currently have file paths as arguments?@nilshamerlinck with my changes I keep retuning file names. What I have noticed is that the method _findfiles is returning relative paths instead of full paths, so without my changes when doing p[pending_path_len:]
the file name is getting messed up.
In my first comment in this PR I am showing where I saw this happening for SFTP.
HI @JordiMForgeFlow
input_dir_pending = "IMPORT"
find_files(".*", "IMPORT")
would return ['IMPORT/file.name']
directory_path
input_dir_pending
@nilshamerlinck I have the following config:
storage's directory_path: empty backend's input_dir_pending: input SFTP server name/version: Version 3
In my case, the method find_files is returning /file.name
instead of input/file.name
thanks @JordiMForgeFlow I will take it into account sorry, a couple more questions:
exchange_filename_pattern
defined on your exchange type?@nilshamerlinck no problem, thank you for looking into it :)
Ex: see SFTP implementation of FS (https://filesystem-spec.readthedocs.io/en/latest/_modules/fsspec/implementations/sftp.html#SFTPFileSystem)
In the method '_decode_stat' which is used to generate the info returned by 'ls', the result is build using the relative path passed to the method 'ls':
out["name"] = "/".join([parent_path.rstrip("/"), stat.filename])