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
a4084ddd
Commit
a4084ddd
authored
Aug 24, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify.
parent
ad6e4d5c
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 @
a4084ddd
...
@@ -165,23 +165,18 @@ class NetworkcacheClient(object):
...
@@ -165,23 +165,18 @@ class NetworkcacheClient(object):
data
=
urllib2
.
urlopen
(
request
).
read
()
data
=
urllib2
.
urlopen
(
request
).
read
()
# Filtering...
# Filtering...
data_list
=
json
.
loads
(
data
)
data_list
=
json
.
loads
(
data
)
if
len
(
data_list
)
>
1
and
not
\
(
self
.
signature_certificate_file_list
or
\
self
.
signature_certificate_url_list
):
raise
DirectoryNotFound
(
'Too many entries for a given directory. '
\
'Directory: %s. Entries: %s.'
%
(
urlmd5
,
str
(
data_list
)))
if
self
.
signature_certificate_file_list
or
\
if
self
.
signature_certificate_file_list
or
\
self
.
signature_certificate_url_list
:
self
.
signature_certificate_url_list
:
method
=
self
.
_verifySignatureInCertificateList
method
=
self
.
_verifySignatureInCertificateList
data_list
=
filter
(
lambda
x
:
method
(
x
[
1
]),
data_list
)
data_list
=
filter
(
lambda
x
:
method
(
x
[
1
]),
data_list
)
if
len
(
data_list
)
>
1
:
raise
DirectoryNotFound
(
'Too many entries for a given key. '
\
'Directory: %s. Entries: %s.'
%
(
urlmd5
,
str
(
data_list
)))
if
not
data_list
:
if
not
data_list
:
raise
DirectoryNotFound
(
'Could not find a trustable entry.'
)
raise
DirectoryNotFound
(
'Could not find a trustable entry.'
)
if
len
(
data_list
)
>
1
:
raise
DirectoryNotFound
(
'Too many entries for a given key. '
\
'Directory: %s. Entries: %s.'
%
(
urlmd5
,
str
(
data_list
)))
information_dict
,
signature
=
data_list
[
0
]
information_dict
,
signature
=
data_list
[
0
]
sha512
=
information_dict
.
get
(
'sha512'
)
sha512
=
information_dict
.
get
(
'sha512'
)
return
self
.
download
(
sha512
)
return
self
.
download
(
sha512
)
...
...
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