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
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
Show 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
...
@@ -20,7 +20,6 @@ import json
import
os
import
os
import
tempfile
import
tempfile
import
urllib
import
urllib
import
urllib2
import
urlparse
import
urlparse
import
M2Crypto
import
M2Crypto
import
socket
import
socket
...
@@ -159,14 +158,10 @@ class NetworkcacheClient(object):
...
@@ -159,14 +158,10 @@ class NetworkcacheClient(object):
Raise DirectoryNotFound if multiple files are found.
Raise DirectoryNotFound if multiple files are found.
'''
'''
url
=
os
.
path
.
join
(
self
.
shadir_url
,
urlmd5
)
url
=
os
.
path
.
join
(
self
.
shadir_url
,
urlmd5
)
request
=
urllib2
.
Request
(
url
=
url
,
data
=
None
,
file_descriptor
=
tempfile
.
NamedTemporaryFile
()
headers
=
self
.
shadir_header_dict
)
path
,
headers
=
urllib
.
urlretrieve
(
url
,
file_descriptor
.
name
)
try
:
file_descriptor
.
seek
(
0
)
result
=
urllib2
.
urlopen
(
request
)
data
=
file_descriptor
.
read
()
data
=
result
.
read
()
except
urllib2
.
HTTPError
,
error
:
raise
DirectoryNotFound
(
"%s : %s"
%
(
error
.
code
,
error
.
msg
))
# Filtering...
# Filtering...
data_list
=
json
.
loads
(
data
)
data_list
=
json
.
loads
(
data
)
if
len
(
data_list
)
>
1
and
not
\
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