Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
Boxiang Sun
slapos.buildout
Commits
c9545718
Commit
c9545718
authored
Mar 22, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print messages that are less frightening
parent
8c7c1e64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/zc/buildout/networkcache.py
src/zc/buildout/networkcache.py
+8
-3
No files found.
src/zc/buildout/networkcache.py
View file @
c9545718
...
@@ -18,6 +18,7 @@ import os
...
@@ -18,6 +18,7 @@ import os
import
posixpath
import
posixpath
import
re
import
re
import
shutil
import
shutil
import
urllib2
import
urlparse
import
urlparse
import
traceback
import
traceback
...
@@ -106,7 +107,7 @@ def download_network_cached(dir_url, cache_url, path, url, logger,
...
@@ -106,7 +107,7 @@ def download_network_cached(dir_url, cache_url, path, url, logger,
logger
.
warning
(
'Incompatible version of networkcache, not using it.'
)
logger
.
warning
(
'Incompatible version of networkcache, not using it.'
)
return
False
return
False
logger
.
info
(
'Downloading %s from network cache
.'
%
url
)
logger
.
debug
(
'Trying to download %s from network cache..
.'
%
url
)
try
:
try
:
file_descriptor
=
nc
.
select
(
directory_key
)
file_descriptor
=
nc
.
select
(
directory_key
)
...
@@ -116,13 +117,17 @@ def download_network_cached(dir_url, cache_url, path, url, logger,
...
@@ -116,13 +117,17 @@ def download_network_cached(dir_url, cache_url, path, url, logger,
finally
:
finally
:
f
.
close
()
f
.
close
()
file_descriptor
.
close
()
file_descriptor
.
close
()
logger
.
info
(
'Downloaded %s from network cache.'
%
url
)
if
not
check_md5sum
(
path
,
md5sum
):
if
not
check_md5sum
(
path
,
md5sum
):
logger
.
info
(
'MD5 checksum mismatch downloading %s'
%
url
)
logger
.
info
(
'MD5 checksum mismatch downloading %s'
%
url
)
return
False
return
False
except
(
IOError
,
DirectoryNotFound
),
e
:
except
(
IOError
,
DirectoryNotFound
),
e
:
logger
.
info
(
'Failed to download from network cache %s: %s'
%
\
if
isinstance
(
e
,
urllib2
.
HTTPError
)
and
e
.
code
==
404
:
logger
.
debug
(
'%s does not exist in network cache.'
%
url
)
else
:
logger
.
debug
(
'Failed to download from network cache %s: %s'
%
\
(
url
,
str
(
e
)))
(
url
,
str
(
e
)))
return
False
return
False
return
True
return
True
...
...
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