Commit 955d4db1 authored by Rafael Monnerat's avatar Rafael Monnerat

Include support to ca files for shacache

  ca file is required for work with Python>=2.7.9
parent 47d7a87e
...@@ -66,11 +66,12 @@ class NetworkCache: ...@@ -66,11 +66,12 @@ class NetworkCache:
self.dir_url = get_('upload-dir-url') self.dir_url = get_('upload-dir-url')
self.cache_url = get_('upload-cache-url') self.cache_url = get_('upload-cache-url')
self.signature_private_key_file = get_('signature_private_key_file') self.signature_private_key_file = get_('signature_private_key_file')
self.shacache_ca_file = get_('shacache-ca-file')
self.shacache_cert_file = get_('shacache-cert-file') self.shacache_cert_file = get_('shacache-cert-file')
self.shacache_key_file = get_('shacache-key-file') self.shacache_key_file = get_('shacache-key-file')
self.shadir_cert_file = get_('shadir-cert-file') self.shadir_cert_file = get_('shadir-cert-file')
self.shadir_key_file = get_('shadir-key-file') self.shadir_key_file = get_('shadir-key-file')
self.shadir_ca_file = get_('shadir-ca-file')
if network_cache_info.has_section('shacache'): if network_cache_info.has_section('shacache'):
self.directory_key = network_cache_info.get('shacache', 'key') self.directory_key = network_cache_info.get('shacache', 'key')
...@@ -97,10 +98,13 @@ class NetworkCache: ...@@ -97,10 +98,13 @@ class NetworkCache:
# convert '' into None in order to call nc nicely # convert '' into None in order to call nc nicely
with NetworkcacheClient(self.cache_url, self.dir_url, with NetworkcacheClient(self.cache_url, self.dir_url,
signature_private_key_file=self.signature_private_key_file or None, signature_private_key_file=self.signature_private_key_file or None,
shacache_ca_file=self.shacache_ca_file or None,
shacache_cert_file=self.shacache_cert_file or None, shacache_cert_file=self.shacache_cert_file or None,
shacache_key_file=self.shacache_key_file or None, shacache_key_file=self.shacache_key_file or None,
shadir_cert_file=self.shadir_cert_file or None, shadir_cert_file=self.shadir_cert_file or None,
shadir_key_file=self.shadir_key_file or None, shadir_key_file=self.shadir_key_file or None,
shadir_ca_file=self.shadir_ca_file or None,
) as nc: ) as nc:
return nc.upload(file_descriptor, key, **metadata_dict) return nc.upload(file_descriptor, key, **metadata_dict)
......
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