Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ exclude: |
^storage_backend/|
^storage_backend_ftp/|
^storage_backend_s3/|
^storage_backend_sftp/|
^storage_file/|
^storage_image/|
^storage_image_product/|
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
fsspec>=2024.5.0
fsspec>=2025.3.0
fsspec[s3]
paramiko
python_slugify
4 changes: 2 additions & 2 deletions storage_backend_sftp/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
{
"name": "Storage Backend SFTP",
"summary": "Implement SFTP Storage",
"version": "18.0.1.0.0",
"version": "19.0.1.0.0",
"category": "Storage",
"website": "https://github.com/OCA/storage",
"author": " Akretion,Odoo Community Association (OCA)",
"license": "LGPL-3",
"installable": False,
"installable": True,
"external_dependencies": {"python": ["paramiko"]},
"depends": ["storage_backend"],
"data": ["views/backend_storage_view.xml"],
Expand Down
10 changes: 4 additions & 6 deletions storage_backend_sftp/components/sftp_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ def sftp_mkdirs(client, path, mode=511):


def load_ssh_key(ssh_key_buffer):
for pkey_class in (
paramiko.RSAKey,
paramiko.DSSKey,
paramiko.ECDSAKey,
paramiko.Ed25519Key,
):
pkey_classes = [paramiko.RSAKey, paramiko.ECDSAKey, paramiko.Ed25519Key]
if hasattr(paramiko, "DSSKey"):
pkey_classes.append(paramiko.DSSKey)
for pkey_class in pkey_classes:
try:
return pkey_class.from_private_key(ssh_key_buffer)
except paramiko.SSHException:
Expand Down
7 changes: 2 additions & 5 deletions storage_backend_sftp/tests/test_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
# @author Simone Orsi <simone.orsi@camptocamp.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

# pylint: disable=missing-manifest-dependency
# disable warning on 'vcr' missing in manifest: this is only a dependency for
# dev/tests

import errno
import logging
Expand Down Expand Up @@ -84,8 +81,8 @@ def test_list(self, mocked_paramiko):
self.assertEqual(self.backend.list_files(), [])

def test_find_files(self):
good_filepaths = ["somepath/file%d.good" % x for x in range(1, 10)]
bad_filepaths = ["somepath/file%d.bad" % x for x in range(1, 10)]
good_filepaths = [f"somepath/file{x}.good" for x in range(1, 10)]
bad_filepaths = [f"somepath/file{x}.bad" for x in range(1, 10)]
mocked_filepaths = bad_filepaths + good_filepaths
backend = self.backend.sudo()
expected = good_filepaths[:]
Expand Down
Loading