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
81e88815
Commit
81e88815
authored
Jun 29, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using PUT instead of POST and fixed the status.
parent
644db70b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
slapos/libnetworkcache.py
slapos/libnetworkcache.py
+4
-4
No files found.
slapos/libnetworkcache.py
View file @
81e88815
...
@@ -75,14 +75,14 @@ class NetworkcacheClient(object):
...
@@ -75,14 +75,14 @@ class NetworkcacheClient(object):
shacache_connection
=
httplib
.
HTTPConnection
(
self
.
shacache_host
,
shacache_connection
=
httplib
.
HTTPConnection
(
self
.
shacache_host
,
self
.
shacache_port
)
self
.
shacache_port
)
try
:
try
:
shacache_connection
.
request
(
'P
OS
T'
,
path
,
file_content
,
shacache_connection
.
request
(
'P
U
T'
,
path
,
file_content
,
self
.
shacache_header_dict
)
self
.
shacache_header_dict
)
result
=
shacache_connection
.
getresponse
()
result
=
shacache_connection
.
getresponse
()
data
=
result
.
read
()
data
=
result
.
read
()
finally
:
finally
:
shacache_connection
.
close
()
shacache_connection
.
close
()
if
result
.
status
!=
20
0
:
if
result
.
status
!=
20
1
:
raise
UploadError
(
'Failed to upload the file to SHACACHE Server.'
\
raise
UploadError
(
'Failed to upload the file to SHACACHE Server.'
\
'URL: %s. Response code: %s. Response data: %s'
%
\
'URL: %s. Response code: %s. Response data: %s'
%
\
(
self
.
shacache_host
,
result
.
status
,
data
))
(
self
.
shacache_host
,
result
.
status
,
data
))
...
@@ -106,14 +106,14 @@ class NetworkcacheClient(object):
...
@@ -106,14 +106,14 @@ class NetworkcacheClient(object):
shadir_connection
=
httplib
.
HTTPConnection
(
self
.
shadir_host
,
shadir_connection
=
httplib
.
HTTPConnection
(
self
.
shadir_host
,
self
.
shadir_port
)
self
.
shadir_port
)
try
:
try
:
shadir_connection
.
request
(
'P
OS
T'
,
path
,
json
.
dumps
(
data
),
shadir_connection
.
request
(
'P
U
T'
,
path
,
json
.
dumps
(
data
),
self
.
shadir_header_dict
)
self
.
shadir_header_dict
)
result
=
shadir_connection
.
getresponse
()
result
=
shadir_connection
.
getresponse
()
data
=
result
.
read
()
data
=
result
.
read
()
finally
:
finally
:
shadir_connection
.
close
()
shadir_connection
.
close
()
if
result
.
status
!=
20
0
:
if
result
.
status
!=
20
1
:
raise
UploadError
(
'Failed to upload data to SHADIR Server.'
\
raise
UploadError
(
'Failed to upload data to SHADIR Server.'
\
'URL: %s. Response code: %s. Response data: %s'
%
\
'URL: %s. Response code: %s. Response data: %s'
%
\
(
self
.
shacache_host
,
result
.
status
,
data
))
(
self
.
shacache_host
,
result
.
status
,
data
))
...
...
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