Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8e9a81df
authored
Jan 29, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed tar.gz to zip
parent
ba4d37ab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
miscellaneous/store-server/CloudStore.py
+4
-5
No files found.
miscellaneous/store-server/CloudStore.py
View file @
8e9a81df
...
...
@@ -76,16 +76,15 @@ def neptun_POST(neptun):
#redirect('http://store.cloud.ik.bme.hu:8080/dl/'+dl_hash)
return
json
.
dumps
({
'LINK'
:
SITE_URL
+
'/dl/'
+
dl_hash
})
else
:
#Tar directore in /home/user
chdir
=
os
.
path
.
dirname
(
dl_path
)
folder_name
=
os
.
path
.
basename
(
dl_path
)
try
:
os
.
makedirs
(
TEMP_DIR
+
'/'
+
neptun
,
0700
)
except
:
pass
temp_path
=
TEMP_DIR
+
'/'
+
neptun
+
'/'
+
folder_name
+
'.tar.gz'
folder_name
=
os
.
path
.
basename
(
dl_path
)
temp_path
=
TEMP_DIR
+
'/'
+
neptun
+
'/'
+
folder_name
+
'.zip'
with
open
(
os
.
devnull
,
"w"
)
as
fnull
:
result
=
subprocess
.
call
([
'/bin/tar'
,
'zcvf'
,
temp_path
,
'-C'
,
chdir
,
folder_name
],
stdout
=
fnull
,
stderr
=
fnull
)
# zip -rqDj vmi.zip /home/tarokkk/vpn-ik
result
=
subprocess
.
call
([
'/usr/bin/zip'
,
'-rqDj'
,
temp_path
,
dl_path
],
stdout
=
fnull
,
stderr
=
fnull
)
os
.
symlink
(
temp_path
,
ROOT_WWW_FOLDER
+
'/'
+
dl_hash
)
return
json
.
dumps
({
'LINK'
:
SITE_URL
+
'/dl/'
+
dl_hash
})
#UPLOAD
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment