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
9dc064d3
Commit
9dc064d3
authored
Jun 15, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved error messages when the user tries to upload a file...
parent
970760af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
slapos/libnetworkcache/__init__.py
slapos/libnetworkcache/__init__.py
+8
-1
No files found.
slapos/libnetworkcache/__init__.py
View file @
9dc064d3
...
...
@@ -97,7 +97,9 @@ class NetworkcacheClient(object):
shacache_connection
.
close
()
if
result
.
status
!=
200
:
raise
UploadError
(
'Failed to upload. Response code: %s. Response data: %s'
%
(
result
.
status
,
data
))
raise
UploadError
(
'Failed to upload the file to SHACACHE Server.'
\
'URL: %s. Response code: %s. Response data: %s'
%
\
(
self
.
shacache_host
,
result
.
status
,
data
))
if
directory_key
is
not
None
:
path
=
os
.
path
.
join
(
self
.
shadir_path
,
directory_key
)
...
...
@@ -124,6 +126,11 @@ class NetworkcacheClient(object):
finally
:
shadir_connection
.
close
()
if
result
.
status
!=
200
:
raise
UploadError
(
'Failed to upload data to SHADIR Server.'
\
'URL: %s. Response code: %s. Response data: %s'
%
\
(
self
.
shacache_host
,
result
.
status
,
data
))
return
json
.
loads
(
data
)
def
download
(
self
,
sha512sum
):
...
...
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