Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.libnetworkcache
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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.libnetworkcache
Commits
cc551033
Commit
cc551033
authored
Sep 25, 2015
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support shacache_ca_file and shadir_ca_file in networkcachehelper.
parent
0782ea0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
slapos/libnetworkcache.py
slapos/libnetworkcache.py
+5
-2
slapos/networkcachehelper.py
slapos/networkcachehelper.py
+10
-6
No files found.
slapos/libnetworkcache.py
View file @
cc551033
...
...
@@ -81,16 +81,19 @@ class NetworkcacheClient(object):
self
.
__new_init
(
*
args
,
**
kw
)
def
__old_init
(
self
,
shacache
,
shadir
,
signature_private_key_file
=
None
,
signature_certificate_list
=
None
,
shacache_key_file
=
None
,
shacache_cert_file
=
None
,
shadir_key_file
=
None
,
shadir_cert_file
=
None
):
signature_certificate_list
=
None
,
shacache_ca_file
=
None
,
shacache_key_file
=
None
,
shacache_cert_file
=
None
,
shadir_ca_file
=
None
,
shadir_key_file
=
None
,
shadir_cert_file
=
None
):
self
.
__new_init
({
'signature-private-key-file'
:
signature_private_key_file
,
'download-cache-url'
:
shacache
,
'upload-cache-url'
:
shacache
,
'shacache-ca-file'
:
shacache_ca_file
,
'shacache-cert-file'
:
shacache_cert_file
,
'shacache-key-file'
:
shacache_key_file
,
'download-dir-url'
:
shadir
,
'upload-dir-url'
:
shadir
,
'shadir-ca-file'
:
shadir_ca_file
,
'shadir-cert-file'
:
shadir_cert_file
,
'shadir-key-file'
:
shadir_key_file
,
},
signature_certificate_list
)
...
...
slapos/networkcachehelper.py
View file @
cc551033
...
...
@@ -21,8 +21,9 @@ from slapos.libnetworkcache import NetworkcacheClient, logger
def
__upload_network_cached
(
dir_url
,
cache_url
,
file_descriptor
,
directory_key
,
signature_private_key_file
,
shacache_cert_file
,
shacache_key_file
,
shadir_cert_file
,
shadir_key_file
,
metadata_dict
=
{}):
signature_private_key_file
,
shacache_ca_file
,
shacache_cert_file
,
shacache_key_file
,
shadir_ca_file
,
shadir_cert_file
,
shadir_key_file
,
metadata_dict
=
{}):
"""
Upload content of a file descriptor to a network cache server using
shacache/shadir API.
...
...
@@ -41,8 +42,10 @@ def __upload_network_cached(dir_url, cache_url,
# convert '' into None in order to call nc nicely
with
NetworkcacheClient
(
cache_url
,
dir_url
,
signature_private_key_file
=
signature_private_key_file
or
None
,
shacache_ca_file
=
shacache_ca_file
or
None
,
shacache_cert_file
=
shacache_cert_file
or
None
,
shacache_key_file
=
shacache_key_file
or
None
,
shadir_ca_file
=
shadir_ca_file
or
None
,
shadir_cert_file
=
shadir_cert_file
or
None
,
shadir_key_file
=
shadir_key_file
or
None
,
)
as
nc
:
...
...
@@ -53,15 +56,16 @@ helper_upload_network_cached_from_file = None
def
helper_upload_network_cached_from_directory
(
dir_url
,
cache_url
,
path
,
directory_key
,
metadata_dict
,
signature_private_key_file
,
shacache_c
ert_file
,
shacache_key
_file
,
shadir_cert_file
,
shadir_key_file
):
signature_private_key_file
,
shacache_c
a_file
,
shacache_cert
_file
,
sha
cache_key_file
,
shadir_ca_file
,
sha
dir_cert_file
,
shadir_key_file
):
"""
Create a tar from a given directory (path) then upload it to networkcache.
"""
return
__upload_network_cached
(
dir_url
,
cache_url
,
NetworkcacheClient
.
archive
(
path
.
rstrip
(
os
.
sep
)),
directory_key
,
signature_private_key_file
,
shacache_cert_file
,
shacache_key_file
,
shadir_cert_file
,
shadir_key_file
,
metadata_dict
)
signature_private_key_file
,
shacache_ca_file
,
shacache_cert_file
,
shacache_key_file
,
shadir_ca_file
,
shadir_cert_file
,
shadir_key_file
,
metadata_dict
)
def
helper_download_network_cached
(
dir_url
,
cache_url
,
...
...
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