Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.buildout
Commits
e9a578c5
Commit
e9a578c5
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
c5036bf4
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
6 deletions
+64
-6
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+20
-0
src/zc/buildout/download.py
src/zc/buildout/download.py
+6
-0
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+16
-2
src/zc/buildout/networkcache.py
src/zc/buildout/networkcache.py
+16
-4
src/zc/buildout/networkcache.txt
src/zc/buildout/networkcache.txt
+4
-0
zc.recipe.egg_/src/zc/recipe/egg/egg.py
zc.recipe.egg_/src/zc/recipe/egg/egg.py
+2
-0
No files found.
src/zc/buildout/buildout.py
View file @
e9a578c5
...
...
@@ -435,8 +435,10 @@ class Buildout(UserDict.DictMixin):
self
.
upload_dir_url
=
None
self
.
signature_private_key_file
=
None
self
.
signature_certificate_list
=
None
self
.
shacache_ca_file
=
None
self
.
shacache_cert_file
=
None
self
.
shacache_key_file
=
None
self
.
shadir_ca_file
=
None
self
.
shadir_cert_file
=
None
self
.
shadir_key_file
=
None
else
:
...
...
@@ -456,10 +458,14 @@ class Buildout(UserDict.DictMixin):
'signature-certificate-list'
,
''
)
self
.
signature_private_key_file
=
networkcache_section
.
get
(
'signature-private-key-file'
,
''
)
self
.
shacache_ca_file
=
networkcache_section
.
get
(
'shacache-ca-file'
,
''
)
self
.
shacache_cert_file
=
networkcache_section
.
get
(
'shacache-cert-file'
,
''
)
self
.
shacache_key_file
=
networkcache_section
.
get
(
'shacache-key-file'
,
''
)
self
.
shadir_ca_file
=
networkcache_section
.
get
(
'shadir-ca-file'
,
''
)
self
.
shadir_cert_file
=
networkcache_section
.
get
(
'shadir-cert-file'
,
''
)
self
.
shadir_key_file
=
networkcache_section
.
get
(
...
...
@@ -483,8 +489,10 @@ class Buildout(UserDict.DictMixin):
options
[
'__networkcache__upload-dir-url'
]
=
self
.
upload_dir_url
options
[
'__networkcache__signature-certificate-list'
]
=
signature_certificate_list
options
[
'__networkcache__signature-private-key-file'
]
=
self
.
signature_private_key_file
options
[
'__networkcache__shacache-ca-file'
]
=
self
.
shacache_ca_file
options
[
'__networkcache__shacache-cert-file'
]
=
self
.
shacache_cert_file
options
[
'__networkcache__shacache-key-file'
]
=
self
.
shacache_key_file
options
[
'__networkcache__shadir-ca-file'
]
=
self
.
shadir_ca_file
options
[
'__networkcache__shadir-cert-file'
]
=
self
.
shadir_cert_file
options
[
'__networkcache__shadir-key-file'
]
=
self
.
shadir_key_file
...
...
@@ -497,8 +505,10 @@ class Buildout(UserDict.DictMixin):
self
.
upload_dir_url
=
None
self
.
signature_private_key_file
=
None
self
.
signature_certificate_list
=
None
self
.
shacache_ca_file
=
None
self
.
shacache_cert_file
=
None
self
.
shacache_key_file
=
None
self
.
shadir_ca_file
=
None
self
.
shadir_cert_file
=
None
self
.
shadir_key_file
=
None
...
...
@@ -542,8 +552,10 @@ class Buildout(UserDict.DictMixin):
upload_dir_url
=
self
.
upload_dir_url
,
signature_private_key_file
=
self
.
signature_private_key_file
,
signature_certificate_list
=
self
.
signature_certificate_list
,
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
,
)
...
...
@@ -1066,8 +1078,10 @@ class Buildout(UserDict.DictMixin):
upload_dir_url
=
self
.
upload_dir_url
,
signature_certificate_list
=
self
.
signature_certificate_list
,
signature_private_key_file
=
self
.
signature_private_key_file
,
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
,
)
...
...
@@ -1192,8 +1206,10 @@ class Buildout(UserDict.DictMixin):
upload_dir_url
=
self
.
upload_dir_url
,
signature_private_key_file
=
self
.
signature_private_key_file
,
signature_certificate_list
=
self
.
signature_certificate_list
,
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
,)
...
...
@@ -1332,10 +1348,14 @@ def _install_and_load(spec, group, entry, buildout):
signature_private_key_file
=
buildout_options
.
get
(
'__networkcache__signature-private-key-file'
),
signature_certificate_list
=
signature_certificate_list
,
shacache_ca_file
=
buildout_options
.
get
(
'__networkcache__shacache-ca-file'
),
shacache_cert_file
=
buildout_options
.
get
(
'__networkcache__shacache-cert-file'
),
shacache_key_file
=
buildout_options
.
get
(
'__networkcache__shacache-key-file'
),
shadir_ca_file
=
buildout_options
.
get
(
'__networkcache__shadir-ca-file'
),
shadir_cert_file
=
buildout_options
.
get
(
'__networkcache__shadir-cert-file'
),
shadir_key_file
=
buildout_options
.
get
(
...
...
src/zc/buildout/download.py
View file @
e9a578c5
...
...
@@ -86,10 +86,14 @@ class Download(object):
if
q
.
strip
()]
self
.
signature_private_key_file
=
options
.
get
(
'__networkcache__signature-private-key-file'
)
self
.
shacache_ca_file
=
options
.
get
(
'__networkcache__shacache-ca-file'
)
self
.
shacache_cert_file
=
options
.
get
(
'__networkcache__shacache-cert-file'
)
self
.
shacache_key_file
=
options
.
get
(
'__networkcache__shacache-key-file'
)
self
.
shadir_ca_file
=
options
.
get
(
'__networkcache__shadir-ca-file'
)
self
.
shadir_cert_file
=
options
.
get
(
'__networkcache__shadir-cert-file'
)
self
.
shadir_key_file
=
options
.
get
(
...
...
@@ -215,8 +219,10 @@ class Download(object):
upload_network_cached
(
self
.
upload_dir_url
,
self
.
upload_cache_url
,
url
,
tmp_path
,
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
)
except
IOError
,
e
:
...
...
src/zc/buildout/easy_install.py
View file @
e9a578c5
...
...
@@ -320,8 +320,10 @@ class AllowHostsPackageIndex(setuptools.package_index.PackageIndex):
upload_index_network_cached(_upload_dir_url,
_upload_cache_url, url, base, self._current_requirement, page, logger,
globals().get('_signature_private_key_file'),
globals().get('_shacache_ca_file'),
globals().get('_shacache_cert_file'),
globals().get('_shacache_key_file'),
globals().get('_shadir_ca_file'),
globals().get('_shadir_cert_file'),
globals().get('_shadir_key_file'))
...
...
@@ -466,8 +468,10 @@ class Installer:
upload_cache_url=None,
signature_certificate_list=None,
signature_private_key_file=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,
):
...
...
@@ -491,12 +495,18 @@ class Installer:
if signature_private_key_file:
global _signature_private_key_file
_signature_private_key_file = signature_private_key_file
if shacache_ca_file:
global _shacache_ca_file
_shacache_ca_file = shacache_ca_file
if shacache_cert_file:
global _shacache_cert_file
_shacache_cert_file = shacache_cert_file
if shacache_key_file:
global _shacache_key_file
_shacache_key_file = shacache_key_file
if shadir_ca_file:
global _shadir_ca_file
_shadir_ca_file = shadir_ca_file
if shadir_cert_file:
global _shadir_cert_file
_shadir_cert_file = shadir_cert_file
...
...
@@ -897,7 +907,8 @@ class Installer:
upload_network_cached(_upload_dir_url,
_upload_cache_url, dist.location, new_location, logger,
_signature_private_key_file,
_shacache_cert_file, _shacache_key_file,
_shacache_ca_file, _shacache_cert_file,
_shacache_key_file, _shadir_ca_file,
_shadir_cert_file, _shadir_key_file)
if (download_cache
...
...
@@ -1304,7 +1315,8 @@ def install(specs, dest,
prefer_final=None, download_dir_url=None, download_cache_url=None,
upload_dir_url=None, upload_cache_url=None,
signature_certificate_list=None, signature_private_key_file=None,
shacache_cert_file=None, shacache_key_file=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, patch_dict=None):
installer = Installer(
dest, links, index, executable, always_unzip, path, newest,
...
...
@@ -1316,8 +1328,10 @@ def install(specs, dest,
upload_cache_url=upload_cache_url,
signature_certificate_list=signature_certificate_list,
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)
return installer.install(specs, working_set, patch_dict=patch_dict)
...
...
src/zc/buildout/networkcache.py
View file @
e9a578c5
...
...
@@ -163,8 +163,8 @@ def download_index_network_cached(dir_url, cache_url, url, requirement, logger,
@
fallback_call
def
upload_network_cached
(
dir_url
,
cache_url
,
external_url
,
path
,
logger
,
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
):
"""Upload file to a network cache server"""
# XXX use helper and FACTOR code
if
not
LIBNETWORKCACHE_ENABLED
:
...
...
@@ -185,10 +185,14 @@ def upload_network_cached(dir_url, cache_url, external_url, path, logger,
# 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
:
...
...
@@ -196,8 +200,10 @@ def upload_network_cached(dir_url, cache_url, external_url, path, logger,
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
:
...
...
@@ -218,8 +224,8 @@ def upload_network_cached(dir_url, cache_url, external_url, path, logger,
@
fallback_call
def
upload_index_network_cached
(
dir_url
,
cache_url
,
external_url
,
base
,
requirement
,
content
,
logger
,
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
):
# XXX use helper and FACTOR code
"""Upload content of a web page to a network cache server"""
if
not
LIBNETWORKCACHE_ENABLED
:
...
...
@@ -243,10 +249,14 @@ def upload_index_network_cached(dir_url, cache_url, external_url, base, requirem
# 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
:
...
...
@@ -254,8 +264,10 @@ def upload_index_network_cached(dir_url, cache_url, external_url, base, requirem
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
:
...
...
src/zc/buildout/networkcache.txt
View file @
e9a578c5
...
...
@@ -703,8 +703,10 @@ that proper keys are used.
>>> write(sample_buildout, 'ncpatch', 'ncpatch.py',
... """
... def patched(self, *args, **kwargs):
... print 'shacache_ca_file', self.shacache_ca_file
... print 'shacache_cert_file', self.shacache_cert_file
... print 'shacache_key_file', self.shacache_key_file
... print 'shadir_ca_file', self.shadir_ca_file
... print 'shadir_cert_file', self.shadir_cert_file
... print 'shadir_key_file', self.shadir_key_file
... return False
...
...
@@ -780,8 +782,10 @@ And see what happens:
Downloading hello.txt from network cache.
Failed to download from network cache hello.txt:...404...
Uploading http://localhost/hello.txt into network cache.
shacache_ca_file /path/to/shacache/ca/file
shacache_cert_file /path/to/shacache/cert/file
shacache_key_file /path/to/shacache/key/file
shadir_ca_file /path/to/shadir/ca/file
shadir_cert_file /path/to/shadir/cert/file
shadir_key_file /path/to/shadir/key/file
download: Downloaded http://localhost/hello.txt
...
...
zc.recipe.egg_/src/zc/recipe/egg/egg.py
View file @
e9a578c5
...
...
@@ -123,8 +123,10 @@ class Eggs(object):
(
'__networkcache__upload-dir-url'
,
'upload_dir_url'
),
(
'__networkcache__signature-private-key-file'
,
'signature_private_key_file'
),
(
'__networkcache__signature-certificate-list'
,
'signature_certificate_list'
),
(
'__networkcache__shacache-ca-file'
,
'shacache_ca_file'
),
(
'__networkcache__shacache-cert-file'
,
'shacache_cert_file'
),
(
'__networkcache__shacache-key-file'
,
'shacache_key_file'
),
(
'__networkcache__shadir-ca-file'
,
'shadir_ca_file'
),
(
'__networkcache__shadir-cert-file'
,
'shadir_cert_file'
),
(
'__networkcache__shadir-key-file'
,
'shadir_key_file'
),
):
...
...
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