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
Ophélie Gagnard
slapos.libnetworkcache
Commits
abaa96e2
Commit
abaa96e2
authored
Mar 29, 2022
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
download,upload: fix --url help
parent
26e67ce8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
slapos/libnetworkcache.py
slapos/libnetworkcache.py
+8
-7
No files found.
slapos/libnetworkcache.py
View file @
abaa96e2
...
...
@@ -479,6 +479,8 @@ class NetworkcacheException(Exception):
DirectoryNotFound
=
UploadError
=
NetworkcacheException
# BBB
key_help
=
\
" The key will be concatenation of PREFIX_KEY, md5(URL) and SUFFIX_KEY."
def
_newArgumentParser
(
url_help
):
parser
=
argparse
.
ArgumentParser
()
...
...
@@ -486,15 +488,14 @@ def _newArgumentParser(url_help):
help
=
'SlapOS configuration file.'
)
parser
.
add_argument
(
'--prefix-key'
,
default
=
''
)
parser
.
add_argument
(
'--suffix-key'
,
default
=
''
)
parser
.
add_argument
(
'--url'
,
help
=
url_help
+
" The key will be concatenation of PREFIX_KEY, md5(URL) and SUFFIX_KEY."
" If not given, the uploaded data is not indexed."
)
parser
.
add_argument
(
'--url'
,
help
=
url_help
)
return
parser
def
cmd_upload
(
*
args
):
parser
=
_newArgumentParser
(
"Upload data pointed to by this argument,"
" unless --file is specified. If argument is not a local path, contents"
" is first downloaded in a temporary file."
)
parser
=
_newArgumentParser
(
"Upload data pointed to by this argument, unless --file is specified."
" Non-local contents is first downloaded to a temporary file."
"%s If not given, the uploaded data is not indexed."
%
key_help
)
parser
.
add_argument
(
'--file'
,
help
=
"Upload the contents of this file, overriding --url"
)
parser
.
add_argument
(
'meta'
,
nargs
=
'*'
,
metavar
=
'KEY=VALUE'
,
...
...
@@ -520,7 +521,7 @@ def cmd_upload(*args):
f
is
None
or
f
.
close
()
def
cmd_download
(
*
args
):
parser
=
_newArgumentParser
(
"URL of data to download."
)
parser
=
_newArgumentParser
(
"URL of data to download."
+
key_help
)
args
=
parser
.
parse_args
(
args
or
sys
.
argv
[
1
:])
nc
=
NetworkcacheClient
(
args
.
config
)
urlmd5
=
hashlib
.
md5
(
args
.
url
.
encode
()).
hexdigest
()
...
...
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