[Debexpo-devel] [debexpo] 11/32: Ensure to make incoming directory
Kentaro Hayashi
kenhys-guest at moszumanska.debian.org
Sat Aug 19 06:51:02 UTC 2017
This is an automated email from the git hooks/post-receive script.
kenhys-guest pushed a commit to branch master
in repository debexpo.
commit 965c1881234d6162ed69235e539585bcf8c3e45d
Author: HAYASHI Kentaro <kenhys at gmail.com>
Date: Tue May 3 21:47:17 2016 +0900
Ensure to make incoming directory
/tmp/debexpo is created by paster setup-app development.ini, but not for
/tmp/debexpo/pub, so it is needed not to cause 500 internal server error
when uploading package.
---
debexpo/controllers/upload.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/debexpo/controllers/upload.py b/debexpo/controllers/upload.py
index 95d3433..ee7ae07 100644
--- a/debexpo/controllers/upload.py
+++ b/debexpo/controllers/upload.py
@@ -97,7 +97,10 @@ class UploadController(BaseController):
log.critical('debexpo.upload.incoming is not writable')
abort(500, 'The incoming directory has not been set up')
- save_path = os.path.join(os.path.join(config['debexpo.upload.incoming'], "pub"), filename)
+ incoming_dir = os.path.join(config['debexpo.upload.incoming'], 'pub')
+ if not os.path.isdir(incoming_dir):
+ os.mkdir(incoming_dir)
+ save_path = os.path.join(incoming_dir, filename)
log.debug('Saving uploaded file to: %s', save_path)
if os.path.exists(save_path):
log.debug("Aborting. File already exists")
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debexpo/debexpo.git
More information about the Debexpo-devel
mailing list