Merge branch '2019.2.1' into hotfix/full-test-run-2019.2.1

This commit is contained in:
Pedro Algarvio 2019-06-05 11:35:09 +01:00 committed by GitHub
commit f8bd47b684
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 151 additions and 36 deletions

View file

@ -27,8 +27,8 @@ pipeline {
sh '''
eval "$(pyenv init -)"
pyenv --version
pyenv install --skip-existing 2.7.15
pyenv shell 2.7.15
pyenv install --skip-existing 3.6.8
pyenv shell 3.6.8
python --version
pip install -U https://github.com/s0undt3ch/nox/archive/hotfix/py2.zip#egg=Nox==2018.10.17
nox --version
@ -39,7 +39,7 @@ pipeline {
steps {
sh '''
eval "$(pyenv init -)"
pyenv shell 2.7.15
pyenv shell 3.6.8
nox -e docs
'''
archiveArtifacts artifacts: 'doc/doc-archive.tar.gz'

View file

@ -127,15 +127,6 @@ repos:
- --py-version=2.7
- --platform=linux
- id: pip-tools-compile
alias: compile-doc-requirements
name: Docs Py2.7 Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/docs\.in)$
args:
- -v
- --py-version=2.7
- --platform=linux
- id: pip-tools-compile
alias: compile-cloud-py2.7-requirements
name: Cloud Py2.7 Requirements
@ -321,6 +312,15 @@ repos:
- -v
- --py-version=3.5
- id: pip-tools-compile
alias: compile-doc-requirements
name: Docs Py3.5 Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/docs\.in)$
args:
- -v
- --py-version=3.5
- --platform=linux
- id: pip-tools-compile
alias: compile-linux-py3.6-tcp-requirements
name: Linux Py3.6 TCP Requirements
@ -436,6 +436,15 @@ repos:
- -v
- --py-version=3.6
- id: pip-tools-compile
alias: compile-doc-requirements
name: Docs Py3.6 Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/docs\.in)$
args:
- -v
- --py-version=3.6
- --platform=linux
- id: pip-tools-compile
alias: compile-linux-py3.7-tcp-requirements
name: Linux Py3.7 TCP Requirements
@ -550,3 +559,12 @@ repos:
args:
- -v
- --py-version=3.7
- id: pip-tools-compile
alias: compile-doc-requirements
name: Docs Py3.7 Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/docs\.in)$
args:
- -v
- --py-version=3.7
- --platform=linux

View file

@ -892,14 +892,20 @@ def lint_tests(session):
_lint(session, '.testing.pylintrc', flags, paths)
@nox.session(python='2.7')
@nox.session(python='3')
def docs(session):
'''
Build Salt's Documentation
'''
session.install('--progress-bar=off', '-r', 'requirements/static/py2.7/docs.txt', silent=PIP_INSTALL_SILENT)
pydir = _get_pydir(session)
if pydir == 'py3.4':
session.error('Sphinx only runs on Python >= 3.5')
session.install(
'--progress-bar=off',
'-r', 'requirements/static/{}/docs.txt'.format(pydir),
silent=PIP_INSTALL_SILENT)
os.chdir('doc/')
session.run('make', 'clean', external=True)
session.run('make', 'html', external=True)
session.run('make', 'html', 'SPHINXOPTS=-W', external=True)
session.run('tar', '-czvf', 'doc-archive.tar.gz', '_build/html')
os.chdir('..')

View file

@ -1 +1 @@
sphinx
sphinx>=2.0.1

View file

@ -2,10 +2,10 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile -o requirements/static/py2.7/docs.txt -v requirements/static/docs.in
# pip-compile -o requirements/static/py3.5/docs.txt -v requirements/static/docs.in
#
alabaster==0.7.12 # via sphinx
babel==2.6.0 # via sphinx
babel==2.7.0 # via sphinx
certifi==2019.3.9 # via requests
chardet==3.0.4 # via requests
docutils==0.14 # via sphinx
@ -14,13 +14,17 @@ imagesize==1.1.0 # via sphinx
jinja2==2.10.1 # via sphinx
markupsafe==1.1.1 # via jinja2
packaging==19.0 # via sphinx
pygments==2.3.1 # via sphinx
pygments==2.4.2 # via sphinx
pyparsing==2.4.0 # via packaging
pytz==2019.1 # via babel
requests==2.21.0 # via sphinx
six==1.12.0 # via packaging, sphinx
requests==2.22.0 # via sphinx
six==1.12.0 # via packaging
snowballstemmer==1.2.1 # via sphinx
sphinx==1.8.5
sphinxcontrib-websupport==1.1.0 # via sphinx
typing==3.6.6 # via sphinx
urllib3==1.24.2 # via requests
sphinx==2.0.1
sphinxcontrib-applehelp==1.0.1 # via sphinx
sphinxcontrib-devhelp==1.0.1 # via sphinx
sphinxcontrib-htmlhelp==1.0.2 # via sphinx
sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.2 # via sphinx
sphinxcontrib-serializinghtml==1.1.3 # via sphinx
urllib3==1.25.3 # via requests

View file

@ -0,0 +1,30 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile -o requirements/static/py3.6/docs.txt -v requirements/static/docs.in
#
alabaster==0.7.12 # via sphinx
babel==2.7.0 # via sphinx
certifi==2019.3.9 # via requests
chardet==3.0.4 # via requests
docutils==0.14 # via sphinx
idna==2.8 # via requests
imagesize==1.1.0 # via sphinx
jinja2==2.10.1 # via sphinx
markupsafe==1.1.1 # via jinja2
packaging==19.0 # via sphinx
pygments==2.4.2 # via sphinx
pyparsing==2.4.0 # via packaging
pytz==2019.1 # via babel
requests==2.22.0 # via sphinx
six==1.12.0 # via packaging
snowballstemmer==1.2.1 # via sphinx
sphinx==2.0.1
sphinxcontrib-applehelp==1.0.1 # via sphinx
sphinxcontrib-devhelp==1.0.1 # via sphinx
sphinxcontrib-htmlhelp==1.0.2 # via sphinx
sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.2 # via sphinx
sphinxcontrib-serializinghtml==1.1.3 # via sphinx
urllib3==1.25.3 # via requests

View file

@ -0,0 +1,30 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile -o requirements/static/py3.7/docs.txt -v requirements/static/docs.in
#
alabaster==0.7.12 # via sphinx
babel==2.7.0 # via sphinx
certifi==2019.3.9 # via requests
chardet==3.0.4 # via requests
docutils==0.14 # via sphinx
idna==2.8 # via requests
imagesize==1.1.0 # via sphinx
jinja2==2.10.1 # via sphinx
markupsafe==1.1.1 # via jinja2
packaging==19.0 # via sphinx
pygments==2.4.2 # via sphinx
pyparsing==2.4.0 # via packaging
pytz==2019.1 # via babel
requests==2.22.0 # via sphinx
six==1.12.0 # via packaging
snowballstemmer==1.2.1 # via sphinx
sphinx==2.0.1
sphinxcontrib-applehelp==1.0.1 # via sphinx
sphinxcontrib-devhelp==1.0.1 # via sphinx
sphinxcontrib-htmlhelp==1.0.2 # via sphinx
sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.2 # via sphinx
sphinxcontrib-serializinghtml==1.1.3 # via sphinx
urllib3==1.25.3 # via requests

View file

@ -1118,13 +1118,12 @@ def __process_multiprocessing_logging_queue(opts, queue):
setup_extended_logging(opts)
while True:
try:
record_dict = queue.get()
if record_dict is None:
record = queue.get()
if record is None:
# A sentinel to stop processing the queue
break
# Just log everything, filtering will happen on the main process
# logging handlers
record = logging.makeLogRecord(record_dict)
logger = logging.getLogger(record.name)
logger.handle(record)
except (EOFError, KeyboardInterrupt, SystemExit):

View file

@ -1032,6 +1032,14 @@ def build_interface(iface, iface_type, enabled, **settings):
rh_major = '7'
else:
rh_major = '6'
elif __grains__['os'] == 'Amazon':
# TODO: Is there a better formula for this? -W. Werner, 2019-05-30
# If not, it will need to be updated whenever Amazon releases
# Amazon Linux 3
if __grains__['osmajorrelease'] == 2:
rh_major = '7'
else:
rh_major = '6'
else:
rh_major = __grains__['osrelease'][:1]

View file

@ -164,11 +164,16 @@ class IPCServer(object):
return return_message
else:
return _null
if six.PY2:
encoding = None
# msgpack deprecated `encoding` starting with version 0.5.2
if msgpack.version >= (0, 5, 2):
# Under Py2 we still want raw to be set to True
msgpack_kwargs = {'raw': six.PY2}
else:
encoding = 'utf-8'
unpacker = msgpack.Unpacker(encoding=encoding)
if six.PY2:
msgpack_kwargs = {'encoding': None}
else:
msgpack_kwargs = {'encoding': 'utf-8'}
unpacker = msgpack.Unpacker(**msgpack_kwargs)
while not stream.closed():
try:
wire_bytes = yield stream.read_bytes(4096, partial=True)
@ -254,11 +259,16 @@ class IPCClient(object):
self.socket_path = socket_path
self._closing = False
self.stream = None
if six.PY2:
encoding = None
# msgpack deprecated `encoding` starting with version 0.5.2
if msgpack.version >= (0, 5, 2):
# Under Py2 we still want raw to be set to True
msgpack_kwargs = {'raw': six.PY2}
else:
encoding = 'utf-8'
self.unpacker = msgpack.Unpacker(encoding=encoding)
if six.PY2:
msgpack_kwargs = {'encoding': None}
else:
msgpack_kwargs = {'encoding': 'utf-8'}
self.unpacker = msgpack.Unpacker(**msgpack_kwargs)
def connected(self):
return self.stream is not None and not self.stream.closed()

View file

@ -76,8 +76,10 @@ class KubernetesTestCase(TestCase, LoaderModuleMockMixin):
{'items': [{'metadata': {'name': 'mock_deployment_name'}}]}}
)
self.assertEqual(kubernetes.deployments(), ['mock_deployment_name'])
# pylint: disable=E1120
self.assertTrue(
kubernetes.kubernetes.client.ExtensionsV1beta1Api().list_namespaced_deployment().to_dict.called)
# pylint: enable=E1120
def test_services(self):
'''
@ -91,7 +93,9 @@ class KubernetesTestCase(TestCase, LoaderModuleMockMixin):
{'items': [{'metadata': {'name': 'mock_service_name'}}]}}
)
self.assertEqual(kubernetes.services(), ['mock_service_name'])
# pylint: disable=E1120
self.assertTrue(kubernetes.kubernetes.client.CoreV1Api().list_namespaced_service().to_dict.called)
# pylint: enable=E1120
def test_pods(self):
'''
@ -105,8 +109,10 @@ class KubernetesTestCase(TestCase, LoaderModuleMockMixin):
{'items': [{'metadata': {'name': 'mock_pod_name'}}]}}
)
self.assertEqual(kubernetes.pods(), ['mock_pod_name'])
# pylint: disable=E1120
self.assertTrue(kubernetes.kubernetes.client.CoreV1Api().
list_namespaced_pod().to_dict.called)
# pylint: enable=E1120
def test_delete_deployments(self):
'''
@ -121,9 +127,11 @@ class KubernetesTestCase(TestCase, LoaderModuleMockMixin):
**{"delete_namespaced_deployment.return_value.to_dict.return_value": {'code': ''}}
)
self.assertEqual(kubernetes.delete_deployment("test"), {'code': 200})
# pylint: disable=E1120
self.assertTrue(
kubernetes.kubernetes.client.ExtensionsV1beta1Api().
delete_namespaced_deployment().to_dict.called)
# pylint: enable=E1120
def test_create_deployments(self):
'''
@ -137,9 +145,11 @@ class KubernetesTestCase(TestCase, LoaderModuleMockMixin):
)
self.assertEqual(kubernetes.create_deployment("test", "default", {}, {},
None, None, None), {})
# pylint: disable=E1120
self.assertTrue(
kubernetes.kubernetes.client.ExtensionsV1beta1Api().
create_namespaced_deployment().to_dict.called)
# pylint: enable=E1120
@staticmethod
def settings(name, value=None):