Commit 519543aa authored by Łukasz Nowak's avatar Łukasz Nowak

Fix naming.

parent a306e450
......@@ -51,7 +51,7 @@ def get_directory_key(url):
return 'slapos-buildout-%s' % urlmd5
def download_network_cached(download_dir_url, download_cache_url, path, url, logger, md5sum=None):
def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
"""Downloads from a network cache provider
If something fail (providor be offline, or hash_string fail), we ignore
......@@ -62,7 +62,7 @@ def download_network_cached(download_dir_url, download_cache_url, path, url, log
if not LIBNETWORKCACHE_ENABLED:
return False
if download_cache_url in (None, '',):
if cache_url in (None, '',):
# Not able to use network cache
return False
if md5sum is None:
......@@ -74,7 +74,7 @@ def download_network_cached(download_dir_url, download_cache_url, path, url, log
logger.info('Downloading %s from network cache.' % file_name)
try:
nc = NetworkcacheClient(shacache=download_cache_url, shadir=download_dir_url)
nc = NetworkcacheClient(shacache=cache_url, shadir=dir_url)
file_content = nc.select(directory_key)
f = open(path, 'w+b')
......@@ -95,12 +95,12 @@ def download_network_cached(download_dir_url, download_cache_url, path, url, log
return True
def upload_network_cached(download_cache_url, download_dir_url, external_url, path, logger):
def upload_network_cached(cache_url, dir_url, external_url, path, logger):
"""Upload file to a network cache server"""
if not LIBNETWORKCACHE_ENABLED:
return False
if download_cache_url in [None, ''] or download_dir_url in [None, '']:
if cache_url in [None, ''] or dir_url in [None, '']:
logger.debug(
'Upload cache ignored, shacache or shadir was not provided!')
return False
......@@ -112,8 +112,8 @@ def upload_network_cached(download_cache_url, download_dir_url, external_url, pa
f = open(path, 'r')
try:
nc = NetworkcacheClient(shacache=download_cache_url,
shadir=download_dir_url)
nc = NetworkcacheClient(shacache=cache_url,
shadir=dir_url)
data = nc.upload(f, directory_key, **kw)
except (IOError, UploadError), e:
logger.info('Fail to upload file. %s' % \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment