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
Łukasz Nowak
slapos.buildout
Commits
41c59a92
Commit
41c59a92
authored
Jun 23, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style fixes.
Keep same ordering and simplify conditions.
parent
136ba144
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
src/zc/buildout/networkcache.py
src/zc/buildout/networkcache.py
+3
-6
No files found.
src/zc/buildout/networkcache.py
View file @
41c59a92
...
@@ -62,8 +62,7 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
...
@@ -62,8 +62,7 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
if
not
LIBNETWORKCACHE_ENABLED
:
if
not
LIBNETWORKCACHE_ENABLED
:
return
False
return
False
if
cache_url
in
(
None
,
''
,):
if
not
(
dir_url
and
cache_url
):
# Not able to use network cache
return
False
return
False
if
md5sum
is
None
:
if
md5sum
is
None
:
md5sum
=
_get_md5_from_url
(
url
)
md5sum
=
_get_md5_from_url
(
url
)
...
@@ -95,14 +94,12 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
...
@@ -95,14 +94,12 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
return
True
return
True
def
upload_network_cached
(
cache_url
,
dir
_url
,
external_url
,
path
,
logger
):
def
upload_network_cached
(
dir_url
,
cache
_url
,
external_url
,
path
,
logger
):
"""Upload file to a network cache server"""
"""Upload file to a network cache server"""
if
not
LIBNETWORKCACHE_ENABLED
:
if
not
LIBNETWORKCACHE_ENABLED
:
return
False
return
False
if
cache_url
in
[
None
,
''
]
or
dir_url
in
[
None
,
''
]:
if
not
(
dir_url
and
cache_url
):
logger
.
debug
(
'Upload cache ignored, shacache or shadir was not provided!'
)
return
False
return
False
file_name
=
external_url
.
split
(
'/'
)[
-
1
].
split
(
'#'
)[
0
].
split
(
'?'
)[
0
]
file_name
=
external_url
.
split
(
'/'
)[
-
1
].
split
(
'#'
)[
0
].
split
(
'?'
)[
0
]
...
...
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