Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos.core
Commits
5d688f16
Commit
5d688f16
authored
Sep 25, 2015
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add shacache-ca-file and shadir-ca-file options.
parent
6f14fd1e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
3 deletions
+39
-3
slapos.cfg.example
slapos.cfg.example
+2
-0
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+9
-2
slapos/grid/networkcache.py
slapos/grid/networkcache.py
+8
-1
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+10
-0
slapos/tests/slapobject.py
slapos/tests/slapobject.py
+10
-0
No files found.
slapos.cfg.example
View file @
5d688f16
...
...
@@ -38,11 +38,13 @@ download-binary-dir-url = http://www.shacache.org/shadir
#signature_private_key_file = /etc/opt/slapos/shacache/signature.key
#signature_certificate_file = /etc/opt/slapos/shacache/signature.cert
#upload-cache-url = https://www.shacache.org/shacache
#shacache-ca-file = /etc/opt/slapos/shacache/ca.cert
#shacache-cert-file = /etc/opt/slapos/shacache/shacache.cert
#shacache-key-file = /etc/opt/slapos/shacache/shacache.key
#upload-binary-dir-url = https://www.shacache.org/shadir
#upload-binary-cache-url = https://www.shacache.org/shacache
#upload-dir-url = https://www.shacache.org/shadir
#shadir-ca-file = /etc/opt/slapos/shacache/ca.cert
#shadir-cert-file = /etc/opt/slapos/shacache/shacache.cert
#shadir-key-file = /etc/opt/slapos/shacache/shacache.key
...
...
slapos/grid/SlapObject.py
View file @
5d688f16
...
...
@@ -103,8 +103,9 @@ class Software(object):
# The key is an url in the case of Buildout.
def
__init__
(
self
,
url
,
software_root
,
buildout
,
logger
,
signature_private_key_file
=
None
,
signature_certificate_list
=
None
,
upload_cache_url
=
None
,
upload_dir_url
=
None
,
shacache_cert_file
=
None
,
shacache_key_file
=
None
,
shadir_cert_file
=
None
,
shadir_key_file
=
None
,
upload_cache_url
=
None
,
upload_dir_url
=
None
,
shacache_ca_file
=
None
,
shacache_cert_file
=
None
,
shacache_key_file
=
None
,
shadir_ca_file
=
None
,
shadir_cert_file
=
None
,
shadir_key_file
=
None
,
download_binary_cache_url
=
None
,
upload_binary_cache_url
=
None
,
download_binary_dir_url
=
None
,
upload_binary_dir_url
=
None
,
download_from_binary_cache_url_blacklist
=
None
,
...
...
@@ -130,8 +131,10 @@ class Software(object):
self
.
signature_certificate_list
=
signature_certificate_list
self
.
upload_cache_url
=
upload_cache_url
self
.
upload_dir_url
=
upload_dir_url
self
.
shacache_ca_file
=
shacache_ca_file
self
.
shacache_cert_file
=
shacache_cert_file
self
.
shacache_key_file
=
shacache_key_file
self
.
shadir_ca_file
=
shadir_ca_file
self
.
shadir_cert_file
=
shadir_cert_file
self
.
shadir_key_file
=
shadir_key_file
self
.
download_binary_cache_url
=
download_binary_cache_url
...
...
@@ -224,8 +227,10 @@ class Software(object):
(
'signature-private-key-file'
,
self
.
signature_private_key_file
),
(
'upload-cache-url'
,
self
.
upload_cache_url
),
(
'upload-dir-url'
,
self
.
upload_dir_url
),
(
'shacache-ca-file'
,
self
.
shacache_ca_file
),
(
'shacache-cert-file'
,
self
.
shacache_cert_file
),
(
'shacache-key-file'
,
self
.
shacache_key_file
),
(
'shadir-ca-file'
,
self
.
shadir_ca_file
),
(
'shadir-cert-file'
,
self
.
shadir_cert_file
),
(
'shadir-key-file'
,
self
.
shadir_key_file
)
]:
...
...
@@ -296,8 +301,10 @@ class Software(object):
self
.
upload_binary_dir_url
,
tarpath
,
self
.
logger
,
self
.
signature_private_key_file
,
self
.
shacache_ca_file
,
self
.
shacache_cert_file
,
self
.
shacache_key_file
,
self
.
shadir_ca_file
,
self
.
shadir_cert_file
,
self
.
shadir_key_file
)
...
...
slapos/grid/networkcache.py
View file @
5d688f16
...
...
@@ -116,7 +116,8 @@ def download_network_cached(cache_url, dir_url, software_url, software_root,
@
fallback_call
def
upload_network_cached
(
software_root
,
software_url
,
cached_key
,
cache_url
,
dir_url
,
path
,
logger
,
signature_private_key_file
,
shacache_cert_file
,
shacache_key_file
,
shadir_cert_file
,
shadir_key_file
):
shacache_ca_file
,
shacache_cert_file
,
shacache_key_file
,
shadir_ca_file
,
shadir_cert_file
,
shadir_key_file
):
"""Upload file to a network cache server"""
if
not
LIBNETWORKCACHE_ENABLED
:
return
False
...
...
@@ -141,10 +142,14 @@ def upload_network_cached(software_root, software_url, cached_key,
# convert '' into None in order to call nc nicely
if
not
signature_private_key_file
:
signature_private_key_file
=
None
if
not
shacache_ca_file
:
shacache_ca_file
=
None
if
not
shacache_cert_file
:
shacache_cert_file
=
None
if
not
shacache_key_file
:
shacache_key_file
=
None
if
not
shadir_ca_file
:
shadir_ca_file
=
None
if
not
shadir_cert_file
:
shadir_cert_file
=
None
if
not
shadir_key_file
:
...
...
@@ -152,8 +157,10 @@ def upload_network_cached(software_root, software_url, cached_key,
try
:
nc
=
NetworkcacheClient
(
cache_url
,
dir_url
,
signature_private_key_file
=
signature_private_key_file
,
shacache_ca_file
=
shacache_ca_file
,
shacache_cert_file
=
shacache_cert_file
,
shacache_key_file
=
shacache_key_file
,
shadir_ca_file
=
shadir_ca_file
,
shadir_cert_file
=
shadir_cert_file
,
shadir_key_file
=
shadir_key_file
)
except
TypeError
:
...
...
slapos/grid/slapgrid.py
View file @
5d688f16
...
...
@@ -118,8 +118,10 @@ def check_missing_files(options):
options
.
get
(
'key_file'
),
options
.
get
(
'cert_file'
),
options
.
get
(
'master_ca_file'
),
options
.
get
(
'shacache-ca-file'
),
options
.
get
(
'shacache-cert-file'
),
options
.
get
(
'shacache-key-file'
),
options
.
get
(
'shadir-ca-file'
),
options
.
get
(
'shadir-cert-file'
),
options
.
get
(
'shadir-key-file'
),
options
.
get
(
'signature_private_key_file'
)
...
...
@@ -221,8 +223,10 @@ def create_slapgrid_object(options, logger):
master_ca_file
=
op
.
get
(
'master_ca_file'
),
certificate_repository_path
=
op
.
get
(
'certificate_repository_path'
),
promise_timeout
=
op
.
get
(
'promise_timeout'
,
PROMISE_TIMEOUT
),
shacache_ca_file
=
op
.
get
(
'shacache-ca-file'
),
shacache_cert_file
=
op
.
get
(
'shacache-cert-file'
),
shacache_key_file
=
op
.
get
(
'shacache-key-file'
),
shadir_ca_file
=
op
.
get
(
'shadir-ca-file'
),
shadir_cert_file
=
op
.
get
(
'shadir-cert-file'
),
shadir_key_file
=
op
.
get
(
'shadir-key-file'
),
forbid_supervisord_automatic_launch
=
string_to_boolean
(
op
.
get
(
'forbid_supervisord_automatic_launch'
,
'false'
)),
...
...
@@ -278,8 +282,10 @@ class Slapgrid(object):
master_ca_file
=
None
,
certificate_repository_path
=
None
,
promise_timeout
=
3
,
shacache_ca_file
=
None
,
shacache_cert_file
=
None
,
shacache_key_file
=
None
,
shadir_ca_file
=
None
,
shadir_cert_file
=
None
,
shadir_key_file
=
None
,
forbid_supervisord_automatic_launch
=
False
,
...
...
@@ -314,8 +320,10 @@ class Slapgrid(object):
self
.
download_binary_dir_url
=
download_binary_dir_url
self
.
upload_binary_dir_url
=
upload_binary_dir_url
self
.
upload_dir_url
=
upload_dir_url
self
.
shacache_ca_file
=
shacache_ca_file
self
.
shacache_cert_file
=
shacache_cert_file
self
.
shacache_key_file
=
shacache_key_file
self
.
shadir_ca_file
=
shadir_ca_file
self
.
shadir_cert_file
=
shadir_cert_file
self
.
shadir_key_file
=
shadir_key_file
self
.
forbid_supervisord_automatic_launch
=
forbid_supervisord_automatic_launch
...
...
@@ -410,8 +418,10 @@ class Slapgrid(object):
download_binary_dir_url
=
self
.
download_binary_dir_url
,
upload_binary_dir_url
=
self
.
upload_binary_dir_url
,
upload_dir_url
=
self
.
upload_dir_url
,
shacache_ca_file
=
self
.
shacache_ca_file
,
shacache_cert_file
=
self
.
shacache_cert_file
,
shacache_key_file
=
self
.
shacache_key_file
,
shadir_ca_file
=
self
.
shadir_ca_file
,
shadir_cert_file
=
self
.
shadir_cert_file
,
shadir_key_file
=
self
.
shadir_key_file
,
software_min_free_space
=
self
.
software_min_free_space
)
...
...
slapos/tests/slapobject.py
View file @
5d688f16
...
...
@@ -190,8 +190,10 @@ class TestSoftwareNetworkCacheSlapObject(MasterMixin, unittest.TestCase):
self
.
signature_private_key_file
=
'/signature/private/key_file'
self
.
upload_cache_url
=
'http://example.com/uploadcache'
self
.
upload_dir_url
=
'http://example.com/uploaddir'
self
.
shacache_ca_file
=
'/path/to/shacache/ca/file'
self
.
shacache_cert_file
=
'/path/to/shacache/cert/file'
self
.
shacache_key_file
=
'/path/to/shacache/key/file'
self
.
shadir_ca_file
=
'/path/to/shadir/ca/file'
self
.
shadir_cert_file
=
'/path/to/shadir/cert/file'
self
.
shadir_key_file
=
'/path/to/shadir/key/file'
...
...
@@ -215,8 +217,10 @@ class TestSoftwareNetworkCacheSlapObject(MasterMixin, unittest.TestCase):
signature_private_key_file
=
'/signature/private/key_file'
,
upload_cache_url
=
'http://example.com/uploadcache'
,
upload_dir_url
=
'http://example.com/uploaddir'
,
shacache_ca_file
=
self
.
shacache_ca_file
,
shacache_cert_file
=
self
.
shacache_cert_file
,
shacache_key_file
=
self
.
shacache_key_file
,
shadir_ca_file
=
self
.
shadir_ca_file
,
shadir_cert_file
=
self
.
shadir_cert_file
,
shadir_key_file
=
self
.
shadir_key_file
)
...
...
@@ -227,8 +231,10 @@ class TestSoftwareNetworkCacheSlapObject(MasterMixin, unittest.TestCase):
self
.
assertIn
(
'networkcache:signature-private-key-file=%s'
%
self
.
signature_private_key_file
,
command_list
)
self
.
assertIn
(
'networkcache:upload-cache-url=%s'
%
self
.
upload_cache_url
,
command_list
)
self
.
assertIn
(
'networkcache:upload-dir-url=%s'
%
self
.
upload_dir_url
,
command_list
)
self
.
assertIn
(
'networkcache:shacache-ca-file=%s'
%
self
.
shacache_ca_file
,
command_list
)
self
.
assertIn
(
'networkcache:shacache-cert-file=%s'
%
self
.
shacache_cert_file
,
command_list
)
self
.
assertIn
(
'networkcache:shacache-key-file=%s'
%
self
.
shacache_key_file
,
command_list
)
self
.
assertIn
(
'networkcache:shadir-ca-file=%s'
%
self
.
shadir_ca_file
,
command_list
)
self
.
assertIn
(
'networkcache:shadir-cert-file=%s'
%
self
.
shadir_cert_file
,
command_list
)
self
.
assertIn
(
'networkcache:shadir-key-file=%s'
%
self
.
shadir_key_file
,
command_list
)
...
...
@@ -278,8 +284,10 @@ class TestSoftwareNetworkCacheSlapObject(MasterMixin, unittest.TestCase):
signature_private_key_file
=
'/signature/private/key_file'
,
upload_cache_url
=
'http://example.com/uploadcache'
,
upload_dir_url
=
'http://example.com/uploaddir'
,
shacache_ca_file
=
self
.
shacache_ca_file
,
shacache_cert_file
=
self
.
shacache_cert_file
,
shacache_key_file
=
self
.
shacache_key_file
,
shadir_ca_file
=
self
.
shadir_ca_file
,
shadir_cert_file
=
self
.
shadir_cert_file
,
shadir_key_file
=
self
.
shadir_key_file
,
upload_to_binary_cache_url_blacklist
=
...
...
@@ -313,8 +321,10 @@ class TestSoftwareNetworkCacheSlapObject(MasterMixin, unittest.TestCase):
upload_dir_url
=
'http://example.com/uploaddir'
,
upload_binary_cache_url
=
'http://example.com/uploadcache'
,
upload_binary_dir_url
=
'http://example.com/uploaddir'
,
shacache_ca_file
=
self
.
shacache_ca_file
,
shacache_cert_file
=
self
.
shacache_cert_file
,
shacache_key_file
=
self
.
shacache_key_file
,
shadir_ca_file
=
self
.
shadir_ca_file
,
shadir_cert_file
=
self
.
shadir_cert_file
,
shadir_key_file
=
self
.
shadir_key_file
,
upload_to_binary_cache_url_blacklist
=
...
...
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