Skip to content

Commit

Permalink
controller: add skip .ddeb files
Browse files Browse the repository at this point in the history
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
  • Loading branch information
LeonidVas committed Dec 7, 2022
1 parent e19ab80 commit 71aa2e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions s3repo/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 71aa2e8

Please sign in to comment.