Commit 1f4ea170 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Update Release Candidate

parents 1ab2efa3 58f925fc
[buildout] [buildout]
extends = extends =
../autoconf/buildout.cfg
../automake/buildout.cfg
../m4/buildout.cfg ../m4/buildout.cfg
../patch/buildout.cfg ../patch/buildout.cfg
../perl/buildout.cfg ../perl/buildout.cfg
...@@ -16,7 +14,15 @@ url = https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.xz ...@@ -16,7 +14,15 @@ url = https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.xz
md5sum = c28f119f405a2304ff0a7ccdcc629713 md5sum = c28f119f405a2304ff0a7ccdcc629713
environment = environment =
M4=${m4:location}/bin/m4 M4=${m4:location}/bin/m4
PATH=${autoconf:location}/bin:${automake:location}/bin:${patch:location}/bin:${perl:location}/bin:${xz-utils:location}/bin:%(PATH)s PATH=${patch:location}/bin:${perl:location}/bin:${xz-utils:location}/bin:%(PATH)s
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/01_inhibit_example_generation#ee2df22601a56d738939fa760f9dc19b ${:_profile_base_location_}/01_inhibit_example_generation#ee2df22601a56d738939fa760f9dc19b
# Make sure that Makefile.in is not older that the other file that is modified
# by the above patch, otherwise `make` would invoke automake, which is likely
# to fail with an error like:
# This is Automake 1.16.5, but the definition used by this AM_INIT_AUTOMAKE
# comes from Automake 1.16.4.
# Without such pre-configure, the 2 files usually have the same modification
# date because machines are fast, but not always.
pre-configure = touch Makefile.in
--- Zope2-2.13.30/src/Shared/DC/Scripts/Signature.py 2022-04-25 08:05:09.312966168 +0000
+++ Zope2-2.13.30/src/Shared/DC/Scripts/Signature.py 2022-04-25 08:06:20.120743425 +0000
@@ -35,7 +35,7 @@ def _setFuncSignature(self, defaults=None, varnames=(), argcount=-1):
argcount = len(varnames)
# Generate a change only if we have to.
if self.func_defaults != defaults:
- self.func_defaults = defaults
+ self.func_defaults = self.__defaults__ = defaults
code = FuncCode(varnames, argcount)
if self.func_code != code:
- self.func_code = code
+ self.func_code = self.__code__ = code
...@@ -61,6 +61,7 @@ environment = ...@@ -61,6 +61,7 @@ environment =
DBUS_GLIB_LIBS=-L${dbus-glib:location}/lib -ldbus-glib-1 DBUS_GLIB_LIBS=-L${dbus-glib:location}/lib -ldbus-glib-1
CPPFLAGS=-I${glib:location}/include/glib-2.0 -I${glib:location}/lib/glib-2.0/include CPPFLAGS=-I${glib:location}/include/glib-2.0 -I${glib:location}/lib/glib-2.0/include
LDFLAGS=-L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib LDFLAGS=-L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib
PYTHON=${buildout:executable}
[gobject-introspection] [gobject-introspection]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
...@@ -79,6 +80,7 @@ environment = ...@@ -79,6 +80,7 @@ environment =
FFI_CFLAGS=-I${libffi:location}/include FFI_CFLAGS=-I${libffi:location}/include
FFI_LIBS=-L${libffi:location}/lib -Wl,-rpath=${libffi:location}/lib -lffi FFI_LIBS=-L${libffi:location}/lib -Wl,-rpath=${libffi:location}/lib -lffi
GIR_DIR=${buildout:parts-directory}/${:_buildout_section_name_}/share/gir-1.0 GIR_DIR=${buildout:parts-directory}/${:_buildout_section_name_}/share/gir-1.0
PYTHON=${buildout:executable}
[pygobject3] [pygobject3]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
...@@ -101,6 +103,7 @@ environment = ...@@ -101,6 +103,7 @@ environment =
GIO_LIBS=-L${glib:location}/lib -lgio-2.0 GIO_LIBS=-L${glib:location}/lib -lgio-2.0
GI_CFLAGS=-I${gobject-introspection:location}/include/gobject-introspection-1.0 GI_CFLAGS=-I${gobject-introspection:location}/include/gobject-introspection-1.0
GI_LIBS=-L${gobject-introspection:location}/lib -lgirepository-1.0 GI_LIBS=-L${gobject-introspection:location}/lib -lgirepository-1.0
PYTHON=${buildout:executable}
[trusted-config] [trusted-config]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
...@@ -114,13 +117,13 @@ python = ${buildout:bin-directory}/${firewalld-eggs:interpreter} ...@@ -114,13 +117,13 @@ python = ${buildout:bin-directory}/${firewalld-eggs:interpreter}
stop-on-error = True stop-on-error = True
command = command =
set -e set -e
sed -i 's#python2.7#${:python}#' ${firewalld:location}/bin/firewall-applet sed -i 's#python3#${:python}#' ${firewalld:location}/bin/firewall-applet
sed -i 's#python2.7#${:python}#' ${firewalld:location}/bin/firewall-cmd sed -i 's#python3#${:python}#' ${firewalld:location}/bin/firewall-cmd
sed -i 's#python2.7#${:python}#' ${firewalld:location}/bin/firewall-config sed -i 's#python3#${:python}#' ${firewalld:location}/bin/firewall-config
sed -i 's#python2.7#${:python}#' ${firewalld:location}/bin/firewall-offline-cmd sed -i 's#python3#${:python}#' ${firewalld:location}/bin/firewall-offline-cmd
sed -i 's#python2.7#${:python}#' ${firewalld:location}/${firewalld:sbin-dir}/firewalld sed -i 's#python3#${:python}#' ${firewalld:location}/${firewalld:sbin-dir}/firewalld
sed -i 's#python2.7 /usr/bin/firewall-config#${:python} ${firewalld:location}/bin/firewall-config#' ${firewalld:etc-dir}/lockdown-whitelist.xml sed -i 's#python3 /usr/bin/firewall-config#${:python} ${firewalld:location}/bin/firewall-config#' ${firewalld:etc-dir}/lockdown-whitelist.xml
sed -i 's#DefaultZone=public#DefaultZone=trusted#' ${firewalld:etc-dir}/firewalld.conf sed -i 's#DefaultZone=public#DefaultZone=trusted#' ${firewalld:etc-dir}/firewalld.conf
sed -i 's#FirewallBackend=nftables#FirewallBackend=iptables#' ${firewalld:etc-dir}/firewalld.conf sed -i 's#FirewallBackend=nftables#FirewallBackend=iptables#' ${firewalld:etc-dir}/firewalld.conf
......
...@@ -49,4 +49,5 @@ configure-options = ...@@ -49,4 +49,5 @@ configure-options =
--enable-python --enable-python
--with-json --with-json
--without-cli --without-cli
--with-python-bin=${buildout:executable}
commit cf5648658c87b6e3b2fa4394b5921792827246dc
Author: Bryce Guinta <bryce.paul.guinta@gmail.com>
Date: Sun Jan 7 14:28:42 2018 -0700
Fix submodule import in six.moves
This commit fixes import errors when modname
started with, but was not equal, to six.moves
---
astroid/brain/pysix_moves.py | 38 ++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/astroid/brain/pysix_moves.py b/astroid/brain/pysix_moves.py
index 548d9761..1db6566a 100644
--- a/astroid/brain/pysix_moves.py
+++ b/astroid/brain/pysix_moves.py
@@ -23,7 +23,8 @@
from astroid import MANAGER, register_module_extender
from astroid.builder import AstroidBuilder
-from astroid.exceptions import AstroidBuildingException
+from astroid.exceptions import AstroidBuildingException, NotFoundError
+from astroid import nodes
def _indent(text, prefix, predicate=None):
"""Adds 'prefix' to the beginning of selected lines in 'text'.
@@ -48,6 +49,7 @@
import CGIHTTPServer
import SimpleHTTPServer
+ import cPickle
from StringIO import StringIO
from cStringIO import StringIO as cStringIO
from UserDict import UserDict
@@ -194,7 +196,7 @@
import html.entities as html_entities
import html.parser as html_parser
import http.client as http_client
- import http.server
+ import http.server as http_server
BaseHTTPServer = CGIHTTPServer = SimpleHTTPServer = http.server
import pickle as cPickle
import queue
@@ -225,7 +227,8 @@
import tkinter.filedialog as tkinter_tkfiledialog
import tkinter.font as tkinter_font
import tkinter.messagebox as tkinter_messagebox
- import urllib.request
+ import urllib
+ import urllib.request as urllib_request
import urllib.robotparser as urllib_robotparser
import urllib.parse as urllib_parse
import urllib.error as urllib_error
@@ -248,10 +251,38 @@
def _six_fail_hook(modname):
- if modname != 'six.moves':
+ """Fix six.moves imports due to the dynamic nature of this
+ class.
+
+ Construct a psuedo-module which contains all the nessecary imports
+ for six
+
+ :param modname: Name of failed module
+ :type modname: str
+
+ :return: An astroid module
+ :rtype: nodes.Module
+ """
+
+ attribute_of = (modname != "six.moves" and
+ modname.startswith("six.moves"))
+ if modname != 'six.moves' and not attribute_of:
raise AstroidBuildingException
module = AstroidBuilder(MANAGER).string_build(_IMPORTS)
module.name = 'six.moves'
+ if attribute_of:
+ # Facilitate import of submodules in Moves
+ start_index = len(module.name)
+ attribute = modname[start_index:].lstrip(".").replace(".", "_")
+ try:
+ import_attr = module.getattr(attribute)[0]
+ except NotFoundError:
+ raise AstroidBuildingException
+ if isinstance(import_attr, nodes.Import):
+ submodule = MANAGER.ast_from_module_name(import_attr.names[0][0])
+ return submodule
+ # Let dummy submodule imports pass through
+ # This will cause an Uninferable result, which is okay
return module
[buildout] [buildout]
parts = parts =
pylint pylint
astroid
extends = extends =
../patch/buildout.cfg ../patch/buildout.cfg
[astroid]
recipe = zc.recipe.egg:custom
egg = astroid
patches =
${:_profile_base_location_}/astroid-six_moves_import_error.patch#377beb0c50f52b9608bb6be7bf93096e
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
[pylint] [pylint]
recipe = zc.recipe.egg:custom recipe = zc.recipe.egg:custom
egg = pylint egg = pylint
patches = patches =
${:_profile_base_location_}/pylint-super_on_old_class.patch#cb0c3f8c091bf4980be395c917edc435 ${:_profile_base_location_}/pylint-super_on_old_class.patch#cb0c3f8c091bf4980be395c917edc435
${:_profile_base_location_}/pylint-redefining-builtins-modules.patch#043defc6e9002ac48b40e078797d4d17
patch-options = -p1 patch-options = -p1
patch-binary = ${patch:location}/bin/patch patch-binary = ${patch:location}/bin/patch
From 258eee33e9a059b704546772b42683699894b52e Mon Sep 17 00:00:00 2001
From: Claudiu Popa <pcmanticore@gmail.com>
Date: Fri, 25 Mar 2016 14:36:31 +0000
Subject: [PATCH] Backport of new option, 'redefining-builtins-modules'.
commit 5674ff98a6cd090578910c2c3bb02e1328f8e6d2
Author: Claudiu Popa <pcmanticore@gmail.com>
Date: Wed Apr 4 20:56:59 2018 +0200
builtins is allowed to redefine builtins. Close #1966
commit 5674ff98a6cd090578910c2c3bb02e1328f8e6d2
Author: Claudiu Popa <pcmanticore@gmail.com>
Date: Wed Apr 4 20:56:59 2018 +0200
builtins is allowed to redefine builtins. Close #1966
commit 44a2431745e61ff7d7ded7db5145da835b5877d1
Author: Claudiu Popa <pcmanticore@gmail.com>
Date: Tue Dec 12 18:10:26 2017 +0100
past.builtins import don't trigger redefined-builtin. Close #1764
commit ad7c2cd38f7213edd1ff37aaead86d5ae8390df4.
Author: Claudiu Popa <pcmanticore@gmail.com>
Date: Fri Mar 25 14:36:31 2016 +0000
Add a new option, 'redefining-builtins-modules'.
The option can be used for controlling the modules
which can redefine builtins, such as six.moves and future.builtins.
Close #464.
---
pylint/checkers/variables.py | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
index 8f6f9574..3223f8f0 100644
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -309,7 +309,13 @@ builtins. Remember that you should avoid to define new builtins when possible.'
'help' : 'List of strings which can identify a callback '
'function by name. A callback name must start or '
'end with one of those strings.'}
- )
+ ),
+ ("redefining-builtins-modules",
+ {'default': ('six.moves', 'past.builtins', 'future.builtins', 'builtins', 'io'), 'type': 'csv',
+ 'metavar': '<comma separated list>',
+ 'help': 'List of qualified module names which can have objects '
+ 'that can redefine builtins.'}
+ ),
)
def __init__(self, linter=None):
BaseChecker.__init__(self, linter)
@@ -323,7 +329,8 @@ builtins. Remember that you should avoid to define new builtins when possible.'
self._to_consume = [(copy(node.locals), {}, 'module')]
for name, stmts in six.iteritems(node.locals):
if is_builtin(name) and not is_inside_except(stmts[0]):
- # do not print Redefining builtin for additional builtins
+ if self._should_ignore_redefined_builtin(stmts[0]):
+ continue
self.add_message('redefined-builtin', args=name, node=stmts[0])
@check_messages('unused-import', 'unused-wildcard-import',
@@ -496,7 +503,7 @@ builtins. Remember that you should avoid to define new builtins when possible.'
dummy_rgx = self.config.dummy_variables_rgx
if not dummy_rgx.match(name):
self.add_message('redefined-outer-name', args=(name, line), node=stmt)
- elif is_builtin(name):
+ elif is_builtin(name) and not self._should_ignore_redefined_builtin(stmt):
# do not print Redefining builtin for additional builtins
self.add_message('redefined-builtin', args=name, node=stmt)
@@ -688,6 +695,11 @@ builtins. Remember that you should avoid to define new builtins when possible.'
and not ass.statement() is node.statement():
self.add_message('undefined-loop-variable', args=name, node=node)
+ def _should_ignore_redefined_builtin(self, stmt):
+ if not isinstance(stmt, astroid.From):
+ return False
+ return stmt.modname in self.config.redefining_builtins_modules
+
@check_messages('redefine-in-handler')
def visit_excepthandler(self, node):
for name in get_all_elements(node.name):
--
2.36.0
#!/bin/sh -e #!/bin/sh -ex
# #
# This simple script to buildout slapos from source using 1.0 branch on # This simple script to buildout slapos from source using 1.0 branch on
# /opt/slapos folder, adapt this script as you please. # /opt/slapos folder, adapt this script as you please.
# #
# Be carefull to not run this script were the script is already installed. # Be carefull to not run this script where slapos-node is already installed.
# #
# Before run this script, ensure dependencies are installed, on debian, you can # Before run this script, ensure dependencies are installed, on debian, you can
# use the command bellow: # use the command bellow:
# #
# apt-get install python gcc g++ make uml-utilities bridge-utils patch wget # apt-get install python3 gcc g++ make patch wget curl
# #
# Use sudo or superuser and create slapos directory (you can pick a different directory) # Use sudo or superuser and create slapos directory (you can pick a different directory)
mkdir -p /opt/slapos/log/ mkdir -p /opt/slapos
cd /opt/slapos/ cd /opt/slapos/
mkdir -p eggs log download-cache/dist
# Create buildout.cfg SlapOS bootstrap file
echo "[buildout]
extends = https://lab.nexedi.com/nexedi/slapos/raw/1.0/component/slapos/buildout.cfg
" > buildout.cfg
# Required in some distros such as Mandriva # Required in some distros such as Mandriva
unset PYTHONPATH unset PYTHONPATH
...@@ -26,17 +22,61 @@ unset PYTHONDONTWRITEBYTECODE ...@@ -26,17 +22,61 @@ unset PYTHONDONTWRITEBYTECODE
unset CONFIG_SITE unset CONFIG_SITE
# #
# Bootstrap SlapOS, using forked version of buildout. # Bootstrap buildout.
# #
wget https://bootstrap.pypa.io/bootstrap-buildout.py cat > buildout.cfg <<EOF
python -S bootstrap-buildout.py --buildout-version 2.5.2+slapos013 \ [buildout]
-f http://www.nexedi.org/static/packages/source/slapos.buildout/ extensions =
download-cache = download-cache
parts =
zc.buildout
# Add location for modified non-official slapos.buildout
find-links +=
http://www.nexedi.org/static/packages/source/
http://www.nexedi.org/static/packages/source/slapos.buildout/
[zc.buildout]
recipe = zc.recipe.egg
eggs =
zc.buildout
[versions]
setuptools = 44.1.1
zc.buildout = 2.7.1+slapos019
zc.recipe.egg = 2.0.3+slapos003
EOF
rm -f bootstrap.py
wget https://lab.nexedi.com/nexedi/slapos.buildout/raw/master/bootstrap/bootstrap.py
python3 -S bootstrap.py \
--setuptools-version 40.8.0 \
--setuptools-to-dir eggs
sed -i '1s/$/ -S/' bin/buildout
bin/buildout buildout:newest=true -v
# Install slapos.libnetworkcache (outside of system libraries, see python -S)
cat > buildout.cfg <<EOF
[buildout]
extends = https://lab.nexedi.com/nexedi/slapos/raw/1.0/component/slapos/buildout.cfg
download-cache = download-cache
parts =
networkcached
[networkcached]
recipe = zc.recipe.egg
eggs =
slapos.libnetworkcache
zc.buildout
EOF
sed -i '1s/$/ -S/' bin/buildout
bin/buildout buildout:newest=true -v
# #
# Warning:Depending on your distribution you might need to # Finally start the big build
# replace python by python2 in the last command. This happens when your
# distribution considers that the standard python is the 3.x branch.
# #
# Finally start to build echo "[buildout]
extends = https://lab.nexedi.com/nexedi/slapos/raw/1.0/component/slapos/buildout.cfg
bin/buildout -v download-cache = download-cache
" > buildout.cfg
bin/buildout buildout:newest=true -v
...@@ -19,14 +19,17 @@ parts = ...@@ -19,14 +19,17 @@ parts =
py py
firewalld-patch firewalld-patch
[python]
part = python3
[environment] [environment]
# Note: For now original PATH is appended to the end, as not all tools are # Note: For now original PATH is appended to the end, as not all tools are
# provided by SlapOS # provided by SlapOS
PATH=${bison:location}/bin:${bzip2:location}/bin:${gettext:location}/bin:${glib:location}/bin:${libxml2:location}/bin:${libxslt:location}/bin:${m4:location}/bin:${ncurses:location}/bin:${openssl:location}/bin:${pkgconfig:location}/bin:${python2.7:location}/bin:${readline:location}/bin:${sqlite3:location}/bin:${swig:location}/bin:${buildout:bin-directory}:${patch:location}/bin:${socat:location}/bin:$PATH PATH=${bison:location}/bin:${bzip2:location}/bin:${gettext:location}/bin:${glib:location}/bin:${libxml2:location}/bin:${libxslt:location}/bin:${m4:location}/bin:${ncurses:location}/bin:${openssl:location}/bin:${pkgconfig:location}/bin:${python:location}/bin:${readline:location}/bin:${sqlite3:location}/bin:${swig:location}/bin:${buildout:bin-directory}:${patch:location}/bin:${socat:location}/bin:$PATH
CFLAGS=-I${bzip2:location}/include -I${gdbm:location}/include -I${gettext:location}/include -I${glib:location}/include -I${libxml2:location}/include -I${libxslt:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${readline:location}/include -I${sqlite3:location}/include -I${zlib:location}/include CFLAGS=-I${bzip2:location}/include -I${gdbm:location}/include -I${gettext:location}/include -I${glib:location}/include -I${libxml2:location}/include -I${libxslt:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${readline:location}/include -I${sqlite3:location}/include -I${zlib:location}/include
CPPFLAGS=${:CFLAGS} CPPFLAGS=${:CFLAGS}
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${libxslt:location}/lib -Wl,-rpath=${libxslt:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${libxslt:location}/lib -Wl,-rpath=${libxslt:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${libxml2:location}/lib/pkgconfig:${libxslt:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${pcre:location}/lib/pkgconfig:${python2.7:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${libxml2:location}/lib/pkgconfig:${libxslt:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${pcre:location}/lib/pkgconfig:${python:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig
LD_LIBRARY_PATH=${bzip2:location}/lib:${gdbm:location}/lib:${gettext:location}/lib:${glib:location}/lib:${libxml2:location}/lib:${libxslt:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${readline:location}/lib:${sqlite3:location}/lib:${zlib:location}/lib LD_LIBRARY_PATH=${bzip2:location}/lib:${gdbm:location}/lib:${gettext:location}/lib:${glib:location}/lib:${libxml2:location}/lib:${libxslt:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${readline:location}/lib:${sqlite3:location}/lib:${zlib:location}/lib
[cfg-environment] [cfg-environment]
......
...@@ -26,7 +26,6 @@ extends-cache = extends-cache ...@@ -26,7 +26,6 @@ extends-cache = extends-cache
download-cache = download-cache download-cache = download-cache
[python] [python]
part = python3
init += init +=
buildout = self.buildout['buildout'] buildout = self.buildout['buildout']
assert buildout['directory'] == buildout['destdir'] + buildout['rootdir'], ( assert buildout['directory'] == buildout['destdir'] + buildout['rootdir'], (
......
...@@ -26,7 +26,7 @@ md5sum = 02ce5d44d49982fda598e3086cfbca99 ...@@ -26,7 +26,7 @@ md5sum = 02ce5d44d49982fda598e3086cfbca99
[profile-caddy-replicate] [profile-caddy-replicate]
filename = instance-apache-replicate.cfg.in filename = instance-apache-replicate.cfg.in
md5sum = bc2a8550c9b603bdfacd3a30a0189218 md5sum = 57388e76c7e61b3d7213df8aac0b407d
[profile-slave-list] [profile-slave-list]
_update_hash_filename_ = templates/apache-custom-slave-list.cfg.in _update_hash_filename_ = templates/apache-custom-slave-list.cfg.in
......
{% set aibcc_enabled = True %} {% set aibcc_enabled = True %}
{% import "caucase" as caucase with context %} {% import "caucase" as caucase with context %}
{#- SERVER_POLLUTED_KEY_LIST is a list of keys which comes from various SlapOS Master implementations, which mix request and publish keys on each slave information -#}
{%- set SERVER_POLLUTED_KEY_LIST = ['connection-parameter-hash', 'timestamp', 'slave_title', 'slap_software_type'] -%}
{%- set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%} {%- set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%}
{%- set GOOD_CIPHER_LIST = ['ECDHE-ECDSA-AES256-GCM-SHA384', 'ECDHE-RSA-AES256-GCM-SHA384', 'ECDHE-ECDSA-AES128-GCM-SHA256', 'ECDHE-RSA-AES128-GCM-SHA256', 'ECDHE-ECDSA-WITH-CHACHA20-POLY1305', 'ECDHE-RSA-WITH-CHACHA20-POLY1305', 'ECDHE-RSA-AES256-CBC-SHA', 'ECDHE-RSA-AES128-CBC-SHA', 'ECDHE-ECDSA-AES256-CBC-SHA', 'ECDHE-ECDSA-AES128-CBC-SHA', 'RSA-AES256-CBC-SHA', 'RSA-AES128-CBC-SHA', 'ECDHE-RSA-3DES-EDE-CBC-SHA', 'RSA-3DES-EDE-CBC-SHA'] %} {%- set GOOD_CIPHER_LIST = ['ECDHE-ECDSA-AES256-GCM-SHA384', 'ECDHE-RSA-AES256-GCM-SHA384', 'ECDHE-ECDSA-AES128-GCM-SHA256', 'ECDHE-RSA-AES128-GCM-SHA256', 'ECDHE-ECDSA-WITH-CHACHA20-POLY1305', 'ECDHE-RSA-WITH-CHACHA20-POLY1305', 'ECDHE-RSA-AES256-CBC-SHA', 'ECDHE-RSA-AES128-CBC-SHA', 'ECDHE-ECDSA-AES256-CBC-SHA', 'ECDHE-ECDSA-AES128-CBC-SHA', 'RSA-AES256-CBC-SHA', 'RSA-AES128-CBC-SHA', 'ECDHE-RSA-3DES-EDE-CBC-SHA', 'RSA-3DES-EDE-CBC-SHA'] %}
{#- Allow to pass only some parameters to frontend nodes #} {#- Allow to pass only some parameters to frontend nodes #}
...@@ -22,6 +20,66 @@ ...@@ -22,6 +20,66 @@
'authenticate-to-backend', 'authenticate-to-backend',
] ]
%} %}
{#- SlapOS Master (but not slapproxy!) merges slave's instance and connection parameters, so the slave information passed to nodes have to be limited only to instance related keys #}
{#- Note: As a result, this feature is very hard to be tested with slapproxy, as it does not pollute the slave information, this kind of whitelist is implemented #}
{%- set FRONTEND_NODE_SLAVE_PASSED_KEY_LIST_SCHEMA = [
'authenticate-to-backend',
'backend-connect-retries',
'backend-connect-timeout',
'ciphers',
'custom_domain',
'default-path',
'disable-no-cache-request',
'disable-via-header',
'disabled-cookie-list',
'enable-http2',
'enable_cache',
'health-check',
'health-check-authenticate-to-failover-backend',
'health-check-failover-https-url',
'health-check-failover-https-url-netloc-list',
'health-check-failover-ssl-proxy-ca-crt',
'health-check-failover-ssl-proxy-verify',
'health-check-failover-url',
'health-check-failover-url-netloc-list',
'health-check-fall',
'health-check-http-method',
'health-check-http-path',
'health-check-http-version',
'health-check-interval',
'health-check-rise',
'health-check-timeout',
'https-only',
'https-url',
'https-url-netloc-list',
'monitor-ipv4-test',
'monitor-ipv6-test',
'path',
'prefer-gzip-encoding-to-backend',
'request-timeout',
'server-alias',
'ssl-proxy-verify',
'ssl_ca_crt',
'ssl_crt',
'ssl_key',
'ssl_proxy_ca_crt',
'strict-transport-security',
'strict-transport-security-preload',
'strict-transport-security-sub-domains',
'type',
'url',
'url-netloc-list',
'virtualhostroot-http-port',
'virtualhostroot-https-port',
'websocket-path-list',
'websocket-transparent',
]
%}
{%- set FRONTEND_NODE_SLAVE_PASSED_KEY_LIST_INTERNAL = [
'slave_reference',
]
%}
{%- set FRONTEND_NODE_SLAVE_PASSED_KEY_LIST = FRONTEND_NODE_SLAVE_PASSED_KEY_LIST_SCHEMA + FRONTEND_NODE_SLAVE_PASSED_KEY_LIST_INTERNAL %}
{% set aikc_enabled = slapparameter_dict.get('automatic-internal-kedifa-caucase-csr', 'true').lower() in TRUE_VALUES %} {% set aikc_enabled = slapparameter_dict.get('automatic-internal-kedifa-caucase-csr', 'true').lower() in TRUE_VALUES %}
{% set aibcc_enabled = slapparameter_dict.get('automatic-internal-backend-client-caucase-csr', 'true').lower() in TRUE_VALUES %} {% set aibcc_enabled = slapparameter_dict.get('automatic-internal-backend-client-caucase-csr', 'true').lower() in TRUE_VALUES %}
{# Ports 8401, 8402 and 8410+1..N are reserved for monitor ports on various partitions #} {# Ports 8401, 8402 and 8410+1..N are reserved for monitor ports on various partitions #}
...@@ -258,9 +316,12 @@ context = ...@@ -258,9 +316,12 @@ context =
{% endif %} {% endif %}
{% if len(slave_error_list) == 0 %} {% if len(slave_error_list) == 0 %}
{# Cleanup slave from not needed keys which come from implementation of SlapOS Master #} {# Cleanup slave from not needed keys which come from implementation of SlapOS Master #}
{% set authorized_slave = slave.copy() %} {# Send only controlled information about the slave to node #}
{% for key in SERVER_POLLUTED_KEY_LIST %} {% set authorized_slave = {} %}
{% do authorized_slave.pop(key, None) %} {% for key in FRONTEND_NODE_SLAVE_PASSED_KEY_LIST + FRONTEND_NODE_SLAVE_PASSED_KEY_LIST %}
{% if key in slave %}
{% do authorized_slave.__setitem__(key, slave[key]) %}
{% endif %}
{% endfor %} {% endfor %}
{% do authorized_slave_list.append(authorized_slave) %} {% do authorized_slave_list.append(authorized_slave) %}
{% else %} {% else %}
...@@ -304,13 +365,13 @@ software-url = {{ frontend_request['software-url'] }} ...@@ -304,13 +365,13 @@ software-url = {{ frontend_request['software-url'] }}
{% if state %} {% if state %}
state = {{ state }} state = {{ state }}
{% endif %} {% endif %}
{# Do not send additional parameters for destroyed nodes #}
{% if state != 'destroyed' %}
config-slave-kedifa-information = ${request-kedifa:connection-slave-kedifa-information} config-slave-kedifa-information = ${request-kedifa:connection-slave-kedifa-information}
config-kedifa-caucase-url = ${request-kedifa:connection-caucase-url} config-kedifa-caucase-url = ${request-kedifa:connection-caucase-url}
config-backend-client-caucase-url = {{ caucase_url }} config-backend-client-caucase-url = {{ caucase_url }}
config-master-key-download-url = ${request-kedifa:connection-master-key-download-url} config-master-key-download-url = ${request-kedifa:connection-master-key-download-url}
config-cluster-identification = {{ instance_parameter_dict['root-instance-title'] }} config-cluster-identification = {{ instance_parameter_dict['root-instance-title'] }}
{# Do not send additional parameters for destroyed nodes #}
{% if state != 'destroyed' %}
{% set node_configuration_dict = {} %} {% set node_configuration_dict = {} %}
{% do node_configuration_dict.update(frontend_request.get('config')) %} {% do node_configuration_dict.update(frontend_request.get('config')) %}
{# sort_keys are important in order to avoid shuffling parameters on each run #} {# sort_keys are important in order to avoid shuffling parameters on each run #}
...@@ -322,12 +383,15 @@ config-{{ config_key }} = {{ dumps(config_value) }} ...@@ -322,12 +383,15 @@ config-{{ config_key }} = {{ dumps(config_value) }}
{%- for config_key, config_value in base_node_configuration_dict.iteritems() %} {%- for config_key, config_value in base_node_configuration_dict.iteritems() %}
config-{{ config_key }} = {{ dumps(config_value) }} config-{{ config_key }} = {{ dumps(config_value) }}
{% endfor -%} {% endfor -%}
{% endif %}
{% if frontend_request.get('sla') %} {% if frontend_request.get('sla') %}
{% for parameter, value in frontend_request.get('sla').iteritems() %} {% for parameter, value in frontend_request.get('sla').iteritems() %}
sla-{{ parameter }} = {{ value }} sla-{{ parameter }} = {{ value }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% else %}
{# Ignore return for destroyed nodes #}
return =
{% endif %}
{% endfor %} {% endfor %}
{% set warning_list = [] %} {% set warning_list = [] %}
......
...@@ -66,6 +66,7 @@ class ERP5Mixin(object): ...@@ -66,6 +66,7 @@ class ERP5Mixin(object):
out = self.captureSlapos( out = self.captureSlapos(
'request', 'test_instance', self._test_software_url, 'request', 'test_instance', self._test_software_url,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
text=True,
) )
print(out) print(out)
return json.loads(self._connexion_parameters_regex.search(out).group(0).replace("'", '"')) return json.loads(self._connexion_parameters_regex.search(out).group(0).replace("'", '"'))
...@@ -150,7 +151,9 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience): ...@@ -150,7 +151,9 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
subprocess.check_call((wait_activities_script, 'erp5'), env={'MYSQL': mysql_bin}) subprocess.check_call((wait_activities_script, 'erp5'), env={'MYSQL': mysql_bin})
# Check that changes have been catalogued # Check that changes have been catalogued
output = subprocess.check_output((mysql_bin, 'erp5', '-e', 'SELECT title FROM catalog WHERE id="portal_types"')) output = subprocess.check_output(
(mysql_bin, 'erp5', '-e', 'SELECT title FROM catalog WHERE id="portal_types"'),
universal_newlines=True)
self.assertIn(new_title, output) self.assertIn(new_title, output)
# Compute backup date in the near future # Compute backup date in the near future
...@@ -185,7 +188,8 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience): ...@@ -185,7 +188,8 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
# Check that mariadb catalog backup contains expected changes # Check that mariadb catalog backup contains expected changes
with gzip.open(os.path.join(mariadb_backup, mariadb_backup_dump)) as f: with gzip.open(os.path.join(mariadb_backup, mariadb_backup_dump)) as f:
self.assertIn(new_title, f.read(), "Mariadb catalog backup %s is not up to date" % mariadb_backup_dump) msg = "Mariadb catalog backup %s is not up to date" % mariadb_backup_dump
self.assertIn(new_title.encode(), f.read(), msg)
def _checkTakeover(self): def _checkTakeover(self):
super(TestTheiaResilienceERP5, self)._checkTakeover() super(TestTheiaResilienceERP5, self)._checkTakeover()
...@@ -205,7 +209,7 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience): ...@@ -205,7 +209,7 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
mysql_bin = os.path.join(mariadb_partition, 'bin', 'mysql') mysql_bin = os.path.join(mariadb_partition, 'bin', 'mysql')
query = 'SELECT title FROM catalog WHERE id="portal_types"' query = 'SELECT title FROM catalog WHERE id="portal_types"'
try: try:
out = subprocess.check_output((mysql_bin, 'erp5', '-e', query)) out = subprocess.check_output((mysql_bin, 'erp5', '-e', query), universal_newlines=True)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
out = '' out = ''
self.assertNotIn(self._erp5_new_title, out) self.assertNotIn(self._erp5_new_title, out)
...@@ -226,5 +230,5 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience): ...@@ -226,5 +230,5 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
self._processEmbeddedInstance(self.test_instance_max_retries) self._processEmbeddedInstance(self.test_instance_max_retries)
# Check that the mariadb catalog was properly restored # Check that the mariadb catalog was properly restored
out = subprocess.check_output((mysql_bin, 'erp5', '-e', query)) out = subprocess.check_output((mysql_bin, 'erp5', '-e', query), universal_newlines=True)
self.assertIn(self._erp5_new_title, out, 'Mariadb catalog is not properly restored') self.assertIn(self._erp5_new_title, out, 'Mariadb catalog is not properly restored')
...@@ -76,7 +76,7 @@ class ResilientTheiaTestCase(ResilientTheiaMixin, TheiaTestCase): ...@@ -76,7 +76,7 @@ class ResilientTheiaTestCase(ResilientTheiaMixin, TheiaTestCase):
# Sleep a bit as an attempt to workaround monitoring boostrap not being ready # Sleep a bit as an attempt to workaround monitoring boostrap not being ready
print("Wait before running slapos node instance one last time") print("Wait before running slapos node instance one last time")
time.sleep(120) time.sleep(120)
cls.callSlapos('node', 'instance', instance_type=instance_type) cls.checkSlapos('node', 'instance', instance_type=instance_type)
@classmethod @classmethod
def _deployEmbeddedSoftware(cls, software_url, instance_name, retries=0, instance_type='export'): def _deployEmbeddedSoftware(cls, software_url, instance_name, retries=0, instance_type='export'):
......
...@@ -492,6 +492,7 @@ eggs = ${neoppod:eggs} ...@@ -492,6 +492,7 @@ eggs = ${neoppod:eggs}
decorator decorator
networkx networkx
# Needed for checking ZODB Components source code # Needed for checking ZODB Components source code
${astroid:egg}
${pylint:egg} ${pylint:egg}
jedi jedi
yapf yapf
...@@ -591,6 +592,8 @@ Acquisition-patches = ${:_profile_base_location_}/../../component/egg-patch/Acqu ...@@ -591,6 +592,8 @@ Acquisition-patches = ${:_profile_base_location_}/../../component/egg-patch/Acqu
Acquisition-patch-options = -p1 Acquisition-patch-options = -p1
python-magic-patches = ${:_profile_base_location_}/../../component/egg-patch/python_magic/magic.patch#de0839bffac17801e39b60873a6c2068 python-magic-patches = ${:_profile_base_location_}/../../component/egg-patch/python_magic/magic.patch#de0839bffac17801e39b60873a6c2068
python-magic-patch-options = -p1 python-magic-patch-options = -p1
Zope2-patches = ${:_profile_base_location_}/../../component/egg-patch/Zope/PythonScript-2.13.patch#124c0d37394dd5020c6fd241ad75cc29
Zope2-patch-options = -p1
[eggs-all-scripts] [eggs-all-scripts]
recipe = zc.recipe.egg recipe = zc.recipe.egg
...@@ -631,8 +634,11 @@ pysvn = 1.9.15+SlapOSPatched001 ...@@ -631,8 +634,11 @@ pysvn = 1.9.15+SlapOSPatched001
python-ldap = 2.4.32+SlapOSPatched001 python-ldap = 2.4.32+SlapOSPatched001
python-magic = 0.4.12+SlapOSPatched001 python-magic = 0.4.12+SlapOSPatched001
PyPDF2 = 1.26.0+SlapOSPatched001 PyPDF2 = 1.26.0+SlapOSPatched001
Zope2 = 2.13.30+SlapOSPatched001
## https://lab.nexedi.com/nexedi/slapos/merge_requests/648 ## https://lab.nexedi.com/nexedi/slapos/merge_requests/648
pylint = 1.4.4 pylint = 1.4.4+SlapOSPatched002
# astroid 1.4.1 breaks testDynamicClassGeneration
astroid = 1.3.8+SlapOSPatched001
# use newer version than specified in ZTK # use newer version than specified in ZTK
PasteDeploy = 1.5.2 PasteDeploy = 1.5.2
...@@ -678,8 +684,6 @@ PyXML = 0.8.5 ...@@ -678,8 +684,6 @@ PyXML = 0.8.5
Pympler = 0.4.3 Pympler = 0.4.3
StructuredText = 2.11.1 StructuredText = 2.11.1
WSGIUtils = 0.7 WSGIUtils = 0.7
# astroid 1.4.1 breaks testDynamicClassGeneration
astroid = 1.3.8
erp5diff = 0.8.1.7 erp5diff = 0.8.1.7
five.formlib = 1.0.4 five.formlib = 1.0.4
five.localsitemanager = 2.0.5 five.localsitemanager = 2.0.5
......
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