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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.libnetworkcache
Commits
ac25bf0c
Commit
ac25bf0c
authored
Aug 22, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify.
Note: Soon the best *one* module will be selected.
parent
86578896
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
slapos/libnetworkcache.py
slapos/libnetworkcache.py
+4
-9
No files found.
slapos/libnetworkcache.py
View file @
ac25bf0c
...
...
@@ -20,7 +20,6 @@ import json
import
os
import
tempfile
import
urllib
import
urllib2
import
urlparse
import
M2Crypto
import
socket
...
...
@@ -159,14 +158,10 @@ class NetworkcacheClient(object):
Raise DirectoryNotFound if multiple files are found.
'''
url
=
os
.
path
.
join
(
self
.
shadir_url
,
urlmd5
)
request
=
urllib2
.
Request
(
url
=
url
,
data
=
None
,
headers
=
self
.
shadir_header_dict
)
try
:
result
=
urllib2
.
urlopen
(
request
)
data
=
result
.
read
()
except
urllib2
.
HTTPError
,
error
:
raise
DirectoryNotFound
(
"%s : %s"
%
(
error
.
code
,
error
.
msg
))
file_descriptor
=
tempfile
.
NamedTemporaryFile
()
path
,
headers
=
urllib
.
urlretrieve
(
url
,
file_descriptor
.
name
)
file_descriptor
.
seek
(
0
)
data
=
file_descriptor
.
read
()
# Filtering...
data_list
=
json
.
loads
(
data
)
if
len
(
data_list
)
>
1
and
not
\
...
...
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