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
Yusei Tahara
slapos.buildout
Commits
6bca3a6f
Commit
6bca3a6f
authored
Jun 22, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The slapos.networkcache should not be required, buildout should work without such library.
parent
92ec8137
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
src/zc/buildout/networkcache.py
src/zc/buildout/networkcache.py
+13
-2
No files found.
src/zc/buildout/networkcache.py
View file @
6bca3a6f
...
...
@@ -19,8 +19,6 @@ import posixpath
import
re
import
urllib
import
urlparse
from
slapos.libnetworkcache
import
NetworkcacheClient
,
UploadError
,
\
DirectoryNotFound
_md5_re
=
re
.
compile
(
r'md5=([a-f0-9]+)'
)
...
...
@@ -54,6 +52,13 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None):
return True if download succeeded.
"""
try
:
from
slapos.libnetworkcache
import
NetworkcacheClient
,
UploadError
,
\
DirectoryNotFound
except
:
return
False
if
sha_cache
in
(
None
,
''
,):
# Not able to use network cache
return
False
...
...
@@ -89,6 +94,12 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None):
def
upload_network_cached
(
sha_cache
,
sha_dir
,
external_url
,
path
,
logger
):
"""Upload file to a shacache server"""
try
:
from
slapos.libnetworkcache
import
NetworkcacheClient
,
UploadError
,
\
DirectoryNotFound
except
:
return
False
if
sha_cache
in
[
None
,
''
]
or
sha_dir
in
[
None
,
''
]:
logger
.
debug
(
'Upload cache ignored, shacache or shadir was not provided!'
)
...
...
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