From eb4ec47f7a49f5db397973ad1dee3d026cae5f6c Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 20 Apr 2016 14:29:11 +0800 Subject: [PATCH] bugfix(upload web) When download file, static file will unreachable. Didn't change dir fixed --- jumpserver/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jumpserver/views.py b/jumpserver/views.py index 70476d1a1..f19885e22 100644 --- a/jumpserver/views.py +++ b/jumpserver/views.py @@ -326,9 +326,9 @@ def download(request): FileLog(user=request.user.username, host=' '.join([asset.hostname for asset in asset_select]), filename=file_path, type='download', remote_ip=remote_ip, result=runner.results).save() logger.debug(runner.results) - os.chdir('/tmp') + #os.chdir('/tmp') tmp_dir_name = os.path.basename(upload_dir) - tar_file = '%s.tar.gz' % upload_dir + tar_file = '/tmp/%s.tar.gz' % upload_dir bash('tar czf %s %s' % (tar_file, tmp_dir_name)) f = open(tar_file) data = f.read()