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
97dbdc77
Commit
97dbdc77
authored
Sep 04, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't raise if there is no matching entry
parent
86264fb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
slapos/networkcachehelper.py
slapos/networkcachehelper.py
+10
-11
No files found.
slapos/networkcachehelper.py
View file @
97dbdc77
...
...
@@ -198,20 +198,19 @@ def helper_download_network_cached(dir_url, cache_url,
matching_entry_list
.
append
(
tags
)
except
Exception
:
pass
if
matching_entry_list
:
# If a strategy is defined, call it to determine best entry
if
strategy
:
best_entry
=
strategy
(
matching_entry_list
)
if
not
best_entry
:
logger
.
info
(
"Can't find best entry matching strategy, selecting "
"random one between acceptable ones."
)
if
strategy
:
best_entry
=
strategy
(
matching_entry_list
)
if
not
best_entry
:
logger
.
info
(
"Can't find best entry matching strategy, selecting "
"random one between acceptable ones."
)
best_entry
=
matching_entry_list
[
0
]
else
:
best_entry
=
matching_entry_list
[
0
]
else
:
best_entry
=
matching_entry_list
[
0
]
# download best entry
file_descriptor
=
nc
.
download
(
best_entry
.
get
(
'sha512'
))
if
file_descriptor
is
not
None
:
# download best entry
file_descriptor
=
nc
.
download
(
best_entry
.
get
(
'sha512'
))
return
file_descriptor
,
tags
else
:
logger
.
info
(
'No matching entry to download from network cache: %s'
\
...
...
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