Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.libnetworkcache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.libnetworkcache
Commits
21f52c30
Commit
21f52c30
authored
Jun 09, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove useless cast to str
parent
2876a77e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
slapos/libnetworkcache.py
slapos/libnetworkcache.py
+2
-2
No files found.
slapos/libnetworkcache.py
View file @
21f52c30
...
@@ -388,7 +388,7 @@ def cmd_upload(*args):
...
@@ -388,7 +388,7 @@ def cmd_upload(*args):
f
=
nc
.
archive
(
args
.
url
)
f
=
nc
.
archive
(
args
.
url
)
else
:
else
:
f
=
urlopen
(
args
.
url
)
f
=
urlopen
(
args
.
url
)
urlmd5
=
str
(
hashlib
.
md5
(
args
.
url
.
encode
()).
hexdigest
()
)
urlmd5
=
hashlib
.
md5
(
args
.
url
.
encode
()).
hexdigest
(
)
nc
.
upload
(
f
,
args
.
prefix_key
+
urlmd5
+
args
.
suffix_key
,
urlmd5
=
urlmd5
,
nc
.
upload
(
f
,
args
.
prefix_key
+
urlmd5
+
args
.
suffix_key
,
urlmd5
=
urlmd5
,
file_name
=
os
.
path
.
basename
(
args
.
url
)
or
"file"
,
file_name
=
os
.
path
.
basename
(
args
.
url
)
or
"file"
,
**
dict
(
x
.
split
(
'='
,
1
)
for
x
in
args
.
meta
))
**
dict
(
x
.
split
(
'='
,
1
)
for
x
in
args
.
meta
))
...
@@ -399,7 +399,7 @@ def cmd_download(*args):
...
@@ -399,7 +399,7 @@ def cmd_download(*args):
parser
=
_newArgumentParser
(
"URL of data to download."
)
parser
=
_newArgumentParser
(
"URL of data to download."
)
args
=
parser
.
parse_args
(
args
or
sys
.
argv
[
1
:])
args
=
parser
.
parse_args
(
args
or
sys
.
argv
[
1
:])
nc
=
NetworkcacheClient
(
args
.
config
)
nc
=
NetworkcacheClient
(
args
.
config
)
urlmd5
=
str
(
hashlib
.
md5
(
args
.
url
.
encode
()).
hexdigest
()
)
urlmd5
=
hashlib
.
md5
(
args
.
url
.
encode
()).
hexdigest
(
)
key
=
args
.
prefix_key
+
urlmd5
+
args
.
suffix_key
key
=
args
.
prefix_key
+
urlmd5
+
args
.
suffix_key
f
=
sys
.
stdout
f
=
sys
.
stdout
shutil
.
copyfileobj
(
nc
.
download
(
next
(
nc
.
select
(
key
))[
'sha512'
]),
shutil
.
copyfileobj
(
nc
.
download
(
next
(
nc
.
select
(
key
))[
'sha512'
]),
...
...
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