From 27111b2962b98244fedc5b7f1004161357519ecf Mon Sep 17 00:00:00 2001 From: Leonid Vasiliev Date: Wed, 7 Dec 2022 21:10:45 +0300 Subject: [PATCH] controller: add skipping .ddeb files As long as we don't process the .ddeb files, we can just skip them and process the rest of the files correctly. Part of #13 --- CHANGELOG.md | 5 +++++ s3repo/controller.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc138fe..be0c780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- Now the `.ddeb` files are simply skipped and all other files in the package + continue to be processed. Previously, this caused fail package uploading. + ## [1.0.5] - 2022-12-07 ### Changed diff --git a/s3repo/controller.py b/s3repo/controller.py index 3499dbe..cb33da1 100644 --- a/s3repo/controller.py +++ b/s3repo/controller.py @@ -82,6 +82,12 @@ def put(self, subpath): package.product = request.form.get('product', '') for _, file in request.files.items(): if not S3Controller.check_filename(file.filename): + # Temporary trick to skip the ".ddeb" files. + if '.' in file.filename and \ + os.path.splitext(file.filename)[1] == '.ddeb': + logging.warning('Skip file: ' + file.filename) + continue + msg = 'Invalid filename. Allowed file extensions: ' +\ ', '.join(ALLOWED_EXTENSIONS) logging.warning(msg)