Commit 0896daca authored by Łukasz Nowak's avatar Łukasz Nowak

Be nice for slapos.libnetworkcache.

Convert buildout emptiness to Nones.
parent 1961d5d4
...@@ -72,6 +72,9 @@ def download_network_cached(dir_url, cache_url, path, url, logger, ...@@ -72,6 +72,9 @@ def download_network_cached(dir_url, cache_url, path, url, logger,
directory_key = get_directory_key(url) directory_key = get_directory_key(url)
url = os.path.basename(url) url = os.path.basename(url)
if len(signature_certificate_list) == 0:
# convert [] into None in order to call nc nicely
signature_certificate_list = None
try: try:
nc = NetworkcacheClient(cache_url, dir_url, nc = NetworkcacheClient(cache_url, dir_url,
signature_certificate_list=signature_certificate_list) signature_certificate_list=signature_certificate_list)
...@@ -119,6 +122,9 @@ def upload_network_cached(dir_url, cache_url, external_url, path, logger, ...@@ -119,6 +122,9 @@ def upload_network_cached(dir_url, cache_url, external_url, path, logger,
urlmd5=hashlib.md5(external_url).hexdigest()) urlmd5=hashlib.md5(external_url).hexdigest())
f = open(path, 'r') f = open(path, 'r')
if not signature_private_key_file:
# convert '' into None in order to call nc nicely
signature_private_key_file = None
try: try:
nc = NetworkcacheClient(cache_url, dir_url, nc = NetworkcacheClient(cache_url, dir_url,
signature_private_key_file=signature_private_key_file) signature_private_key_file=signature_private_key_file)
......
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