Skip to content

Commit

Permalink
fix issue when temp dir does not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelmuller committed Mar 28, 2017
1 parent 573d542 commit ad30857
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/views/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from web.views.helpers import get_or_404, requires_permission, file_download, clean_modules, clean_repositories
from fame.common.config import fame_config
from fame.common.constants import FAME_ROOT, MODULES_ROOT
from fame.common.utils import get_class
from fame.common.utils import get_class, tempdir
from fame.common.exceptions import MissingConfiguration
from fame.core.module import ModuleInfo
from fame.core.config import Config
Expand Down Expand Up @@ -445,8 +445,8 @@ def repository_new(self):
@route('/download', methods=['GET'])
def download(self):
# First, create a zip file with the modules
f, path = mkstemp(dir=fame_config.temp_path)
with ZipFile(os.fdopen(f, 'w'), 'w') as zipf:
path = os.path.join(tempdir(), 'modules.zip')
with ZipFile(path, 'w') as zipf:
for root, dirs, files in os.walk(MODULES_ROOT):
for filename in files:
# Ignore pyc files
Expand Down

0 comments on commit ad30857

Please sign in to comment.