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
3ff69dc4
Commit
3ff69dc4
authored
Jan 26, 2012
by
Yingjie Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generic select function.
Fetch all trustable entries and let client decide which entries to use.
parent
d3aec190
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
slapos/libnetworkcache.py
slapos/libnetworkcache.py
+19
-0
No files found.
slapos/libnetworkcache.py
View file @
3ff69dc4
...
@@ -299,6 +299,25 @@ class NetworkcacheClient(object):
...
@@ -299,6 +299,25 @@ class NetworkcacheClient(object):
traceback
.
format_exc
()))
traceback
.
format_exc
()))
return
self
.
download
(
sha512
)
return
self
.
download
(
sha512
)
def
select_generic
(
self
,
key
):
''' Select trustable entries from shadir.
'''
url
=
os
.
path
.
join
(
self
.
shadir_url
,
key
)
request
=
urllib2
.
Request
(
url
=
url
,
data
=
None
,
headers
=
self
.
shadir_header_dict
)
data
=
urllib2
.
urlopen
(
request
).
read
()
try
:
data_list
=
json
.
loads
(
data
)
except
Exception
:
raise
DirectoryNotFound
(
'It was impossible to parse json response:
\
n
%s'
%
traceback
.
format_exc
())
filtered_data_list
=
[]
for
data
in
data_list
:
if
len
(
data
[
1
]):
if
self
.
_verifySignatureInCertificateList
(
data
[
0
],
data
[
1
]):
filtered_data_list
.
append
(
data
)
return
filtered_data_list
def
_getSignatureString
(
self
,
content
):
def
_getSignatureString
(
self
,
content
):
"""
"""
Return the signature based on certification file.
Return the signature based on certification file.
...
...
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