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
735103da
Commit
735103da
authored
Jun 22, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload: make indexing optional
parent
21f52c30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
slapos/libnetworkcache.py
slapos/libnetworkcache.py
+8
-2
No files found.
slapos/libnetworkcache.py
View file @
735103da
...
@@ -366,8 +366,9 @@ def _newArgumentParser(url_help):
...
@@ -366,8 +366,9 @@ def _newArgumentParser(url_help):
help
=
'SlapOS configuration file.'
)
help
=
'SlapOS configuration file.'
)
parser
.
add_argument
(
'--prefix-key'
,
default
=
''
)
parser
.
add_argument
(
'--prefix-key'
,
default
=
''
)
parser
.
add_argument
(
'--suffix-key'
,
default
=
''
)
parser
.
add_argument
(
'--suffix-key'
,
default
=
''
)
parser
.
add_argument
(
'--url'
,
required
=
True
,
help
=
url_help
parser
.
add_argument
(
'--url'
,
help
=
url_help
+
" The key will be concatenation of PREFIX_KEY, md5(URL) and SUFFIX_KEY."
)
+
" The key will be concatenation of PREFIX_KEY, md5(URL) and SUFFIX_KEY."
" If not given, the uploaded data is not indexed."
)
return
parser
return
parser
def
cmd_upload
(
*
args
):
def
cmd_upload
(
*
args
):
...
@@ -384,6 +385,11 @@ def cmd_upload(*args):
...
@@ -384,6 +385,11 @@ def cmd_upload(*args):
try
:
try
:
if
args
.
file
:
if
args
.
file
:
f
=
open
(
args
.
file
,
'rb'
)
f
=
open
(
args
.
file
,
'rb'
)
if
not
args
.
url
:
nc
.
upload
(
f
)
return
elif
args
.
url
:
parser
.
error
(
'either --file or --url is required'
)
elif
os
.
path
.
isdir
(
args
.
url
):
elif
os
.
path
.
isdir
(
args
.
url
):
f
=
nc
.
archive
(
args
.
url
)
f
=
nc
.
archive
(
args
.
url
)
else
:
else
:
...
...
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