2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-02-20 16:40:10 +00:00
|
|
|
noxfile
|
|
|
|
~~~~~~~
|
|
|
|
|
|
|
|
Nox configuration script
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-04-09 11:32:38 +01:00
|
|
|
# pylint: disable=resource-leakage,3rd-party-module-not-gated
|
2019-02-20 16:40:10 +00:00
|
|
|
|
2020-04-02 20:10:20 -05:00
|
|
|
|
2019-02-20 16:40:10 +00:00
|
|
|
import datetime
|
2019-04-12 12:02:51 +01:00
|
|
|
import glob
|
2019-02-20 16:40:10 +00:00
|
|
|
import os
|
2019-04-12 12:02:51 +01:00
|
|
|
import shutil
|
2019-06-14 13:07:49 +01:00
|
|
|
import sys
|
2019-04-13 16:24:41 +01:00
|
|
|
import tempfile
|
2019-03-16 19:00:01 +00:00
|
|
|
|
2020-04-02 20:10:20 -05:00
|
|
|
# fmt: off
|
2020-04-09 11:32:38 +01:00
|
|
|
if __name__ == "__main__":
|
|
|
|
sys.stderr.write(
|
|
|
|
"Do not execute this file directly. Use nox instead, it will know how to handle this file\n"
|
|
|
|
)
|
2019-02-20 16:40:10 +00:00
|
|
|
sys.stderr.flush()
|
|
|
|
exit(1)
|
2020-04-02 20:10:20 -05:00
|
|
|
# fmt: on
|
2019-02-20 16:40:10 +00:00
|
|
|
|
|
|
|
import nox # isort:skip
|
2019-03-22 17:27:01 +00:00
|
|
|
from nox.command import CommandFailed # isort:skip
|
2020-04-02 20:10:20 -05:00
|
|
|
|
2019-06-05 12:07:28 -06:00
|
|
|
IS_PY3 = sys.version_info > (2,)
|
|
|
|
|
2019-04-11 16:31:48 +01:00
|
|
|
# Be verbose when runing under a CI context
|
2020-04-17 21:37:42 +01:00
|
|
|
CI_RUN = (
|
|
|
|
os.environ.get("JENKINS_URL")
|
|
|
|
or os.environ.get("CI")
|
|
|
|
or os.environ.get("DRONE") is not None
|
|
|
|
)
|
|
|
|
PIP_INSTALL_SILENT = CI_RUN is False
|
2020-05-13 07:12:57 +01:00
|
|
|
SKIP_REQUIREMENTS_INSTALL = "SKIP_REQUIREMENTS_INSTALL" in os.environ
|
2020-05-19 06:54:53 +01:00
|
|
|
EXTRA_REQUIREMENTS_INSTALL = os.environ.get("EXTRA_REQUIREMENTS_INSTALL")
|
2019-04-01 19:41:26 +01:00
|
|
|
|
2019-02-20 16:40:10 +00:00
|
|
|
# Global Path Definitions
|
|
|
|
REPO_ROOT = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
SITECUSTOMIZE_DIR = os.path.join(REPO_ROOT, "tests", "support", "coverage")
|
2019-10-28 13:55:06 +00:00
|
|
|
IS_DARWIN = sys.platform.lower().startswith("darwin")
|
2019-03-01 23:25:31 +00:00
|
|
|
IS_WINDOWS = sys.platform.lower().startswith("win")
|
2020-06-03 13:58:37 +01:00
|
|
|
IS_FREEBSD = sys.platform.lower().startswith("freebsd")
|
2019-02-20 16:40:10 +00:00
|
|
|
# Python versions to run against
|
2021-12-22 15:02:56 +01:00
|
|
|
_PYTHON_VERSIONS = ("3", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10")
|
2019-02-20 16:40:10 +00:00
|
|
|
|
|
|
|
# Nox options
|
|
|
|
# Reuse existing virtualenvs
|
|
|
|
nox.options.reuse_existing_virtualenvs = True
|
|
|
|
# Don't fail on missing interpreters
|
|
|
|
nox.options.error_on_missing_interpreters = False
|
|
|
|
|
2019-10-31 10:14:36 +00:00
|
|
|
# Change current directory to REPO_ROOT
|
|
|
|
os.chdir(REPO_ROOT)
|
|
|
|
|
2019-06-08 18:19:01 +01:00
|
|
|
RUNTESTS_LOGFILE = os.path.join(
|
|
|
|
"artifacts",
|
|
|
|
"logs",
|
|
|
|
"runtests-{}.log".format(datetime.datetime.now().strftime("%Y%m%d%H%M%S.%f")),
|
|
|
|
)
|
|
|
|
|
2019-11-27 15:10:21 +00:00
|
|
|
# Prevent Python from writing bytecode
|
2020-08-14 15:19:49 +01:00
|
|
|
os.environ["PYTHONDONTWRITEBYTECODE"] = "1"
|
2019-11-27 15:10:21 +00:00
|
|
|
|
2019-03-16 19:00:01 +00:00
|
|
|
|
2020-06-08 09:14:07 +01:00
|
|
|
def find_session_runner(session, name, **kwargs):
|
|
|
|
for s, _ in session._runner.manifest.list_all_sessions():
|
|
|
|
if name not in s.signatures:
|
|
|
|
continue
|
|
|
|
for signature in s.signatures:
|
|
|
|
for key, value in kwargs.items():
|
|
|
|
param = "{}={!r}".format(key, value)
|
|
|
|
if IS_PY3:
|
|
|
|
# Under Python2 repr unicode string are always "u" prefixed, ie, u'a string'.
|
|
|
|
param = param.replace("u'", "'")
|
|
|
|
if param not in signature:
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
return s
|
|
|
|
continue
|
|
|
|
session.error(
|
|
|
|
"Could not find a nox session by the name {!r} with the following keyword arguments: {!r}".format(
|
|
|
|
name, kwargs
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-02-20 16:40:10 +00:00
|
|
|
def _create_ci_directories():
|
|
|
|
for dirname in ("logs", "coverage", "xml-unittests-output"):
|
2019-10-31 10:14:36 +00:00
|
|
|
path = os.path.join("artifacts", dirname)
|
2019-02-20 16:40:10 +00:00
|
|
|
if not os.path.exists(path):
|
|
|
|
os.makedirs(path)
|
|
|
|
|
|
|
|
|
2019-04-12 12:02:51 +01:00
|
|
|
def _get_session_python_version_info(session):
|
2019-04-05 15:56:16 +01:00
|
|
|
try:
|
2019-04-12 12:02:51 +01:00
|
|
|
version_info = session._runner._real_python_version_info
|
2019-04-05 15:56:16 +01:00
|
|
|
except AttributeError:
|
2019-06-14 13:07:49 +01:00
|
|
|
old_install_only_value = session._runner.global_config.install_only
|
|
|
|
try:
|
|
|
|
# Force install only to be false for the following chunk of code
|
|
|
|
# For additional information as to why see:
|
|
|
|
# https://github.com/theacodes/nox/pull/181
|
|
|
|
session._runner.global_config.install_only = False
|
|
|
|
session_py_version = session.run(
|
|
|
|
"python",
|
2021-08-03 08:40:21 +01:00
|
|
|
"-c",
|
2019-06-14 13:07:49 +01:00
|
|
|
'import sys; sys.stdout.write("{}.{}.{}".format(*sys.version_info))',
|
|
|
|
silent=True,
|
|
|
|
log=False,
|
|
|
|
)
|
|
|
|
version_info = tuple(
|
|
|
|
int(part) for part in session_py_version.split(".") if part.isdigit()
|
2020-04-02 20:10:20 -05:00
|
|
|
)
|
2019-06-14 13:07:49 +01:00
|
|
|
session._runner._real_python_version_info = version_info
|
|
|
|
finally:
|
|
|
|
session._runner.global_config.install_only = old_install_only_value
|
2019-04-12 12:02:51 +01:00
|
|
|
return version_info
|
|
|
|
|
|
|
|
|
|
|
|
def _get_session_python_site_packages_dir(session):
|
|
|
|
try:
|
|
|
|
site_packages_dir = session._runner._site_packages_dir
|
|
|
|
except AttributeError:
|
2019-06-14 13:07:49 +01:00
|
|
|
old_install_only_value = session._runner.global_config.install_only
|
|
|
|
try:
|
|
|
|
# Force install only to be false for the following chunk of code
|
|
|
|
# For additional information as to why see:
|
|
|
|
# https://github.com/theacodes/nox/pull/181
|
|
|
|
session._runner.global_config.install_only = False
|
|
|
|
site_packages_dir = session.run(
|
|
|
|
"python",
|
2021-08-03 08:40:21 +01:00
|
|
|
"-c",
|
2019-06-14 13:07:49 +01:00
|
|
|
"import sys; from distutils.sysconfig import get_python_lib; sys.stdout.write(get_python_lib())",
|
|
|
|
silent=True,
|
|
|
|
log=False,
|
|
|
|
)
|
|
|
|
session._runner._site_packages_dir = site_packages_dir
|
|
|
|
finally:
|
|
|
|
session._runner.global_config.install_only = old_install_only_value
|
2019-04-12 12:02:51 +01:00
|
|
|
return site_packages_dir
|
|
|
|
|
|
|
|
|
|
|
|
def _get_pydir(session):
|
|
|
|
version_info = _get_session_python_version_info(session)
|
2020-05-19 06:54:53 +01:00
|
|
|
if version_info < (3, 5):
|
|
|
|
session.error("Only Python >= 3.5 is supported")
|
2021-02-22 18:44:17 +00:00
|
|
|
if IS_WINDOWS and version_info < (3, 6):
|
|
|
|
session.error("Only Python >= 3.6 is supported on Windows")
|
2019-04-12 12:02:51 +01:00
|
|
|
return "py{}.{}".format(*version_info)
|
|
|
|
|
|
|
|
|
|
|
|
def _install_system_packages(session):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-12 12:02:51 +01:00
|
|
|
Because some python packages are provided by the distribution and cannot
|
|
|
|
be pip installed, and because we don't want the whole system python packages
|
|
|
|
on our virtualenvs, we copy the required system python packages into
|
|
|
|
the virtualenv
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-12 12:02:51 +01:00
|
|
|
version_info = _get_session_python_version_info(session)
|
|
|
|
py_version_keys = ["{}".format(*version_info), "{}.{}".format(*version_info)]
|
|
|
|
session_site_packages_dir = _get_session_python_site_packages_dir(session)
|
2020-05-19 07:56:26 +01:00
|
|
|
session_site_packages_dir = os.path.relpath(session_site_packages_dir, REPO_ROOT)
|
|
|
|
for py_version in py_version_keys:
|
|
|
|
dist_packages_path = "/usr/lib/python{}/dist-packages".format(py_version)
|
|
|
|
if not os.path.isdir(dist_packages_path):
|
2019-04-12 12:02:51 +01:00
|
|
|
continue
|
2020-05-19 07:56:26 +01:00
|
|
|
for aptpkg in glob.glob(os.path.join(dist_packages_path, "*apt*")):
|
|
|
|
src = os.path.realpath(aptpkg)
|
|
|
|
dst = os.path.join(session_site_packages_dir, os.path.basename(src))
|
|
|
|
if os.path.exists(dst):
|
|
|
|
session.log("Not overwritting already existing %s with %s", dst, src)
|
|
|
|
continue
|
|
|
|
session.log("Copying %s into %s", src, dst)
|
|
|
|
if os.path.isdir(src):
|
|
|
|
shutil.copytree(src, dst)
|
|
|
|
else:
|
|
|
|
shutil.copyfile(src, dst)
|
2019-03-24 20:21:01 +00:00
|
|
|
|
2019-04-01 19:41:26 +01:00
|
|
|
|
2021-02-25 09:43:44 +00:00
|
|
|
def _get_pip_requirements_file(session, transport, crypto=None, requirements_type="ci"):
|
|
|
|
assert requirements_type in ("ci", "pkg")
|
2019-04-01 19:41:26 +01:00
|
|
|
pydir = _get_pydir(session)
|
|
|
|
|
2019-03-20 14:02:51 +00:00
|
|
|
if IS_WINDOWS:
|
2020-04-27 09:09:05 +01:00
|
|
|
if crypto is None:
|
|
|
|
_requirements_file = os.path.join(
|
2020-09-14 08:26:48 +01:00
|
|
|
"requirements",
|
|
|
|
"static",
|
2021-02-25 09:43:44 +00:00
|
|
|
requirements_type,
|
2020-09-14 08:26:48 +01:00
|
|
|
pydir,
|
|
|
|
"{}-windows.txt".format(transport),
|
2020-04-27 09:09:05 +01:00
|
|
|
)
|
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements", "static", requirements_type, pydir, "windows.txt"
|
2020-04-27 09:09:05 +01:00
|
|
|
)
|
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements", "static", requirements_type, pydir, "windows-crypto.txt"
|
2019-10-28 13:55:06 +00:00
|
|
|
)
|
2020-04-27 09:09:05 +01:00
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
2021-09-13 11:11:35 +01:00
|
|
|
session.error("Could not find a windows requirements file for {}".format(pydir))
|
2019-10-28 13:55:06 +00:00
|
|
|
elif IS_DARWIN:
|
2020-04-27 09:09:05 +01:00
|
|
|
if crypto is None:
|
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements",
|
|
|
|
"static",
|
|
|
|
requirements_type,
|
|
|
|
pydir,
|
|
|
|
"{}-darwin.txt".format(transport),
|
2020-04-27 09:09:05 +01:00
|
|
|
)
|
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements", "static", requirements_type, pydir, "darwin.txt"
|
2020-04-27 09:09:05 +01:00
|
|
|
)
|
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements", "static", requirements_type, pydir, "darwin-crypto.txt"
|
2019-10-28 13:55:06 +00:00
|
|
|
)
|
2020-04-27 09:09:05 +01:00
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
2021-09-13 11:11:35 +01:00
|
|
|
session.error("Could not find a darwin requirements file for {}".format(pydir))
|
2020-06-03 13:58:37 +01:00
|
|
|
elif IS_FREEBSD:
|
|
|
|
if crypto is None:
|
|
|
|
_requirements_file = os.path.join(
|
2020-09-14 08:26:48 +01:00
|
|
|
"requirements",
|
|
|
|
"static",
|
2021-02-25 09:43:44 +00:00
|
|
|
requirements_type,
|
2020-09-14 08:26:48 +01:00
|
|
|
pydir,
|
|
|
|
"{}-freebsd.txt".format(transport),
|
2020-06-03 13:58:37 +01:00
|
|
|
)
|
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements", "static", requirements_type, pydir, "freebsd.txt"
|
2020-06-03 13:58:37 +01:00
|
|
|
)
|
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements", "static", requirements_type, pydir, "freebsd-crypto.txt"
|
2020-06-03 13:58:37 +01:00
|
|
|
)
|
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
2021-09-13 11:11:35 +01:00
|
|
|
session.error("Could not find a freebsd requirements file for {}".format(pydir))
|
2019-03-20 14:02:51 +00:00
|
|
|
else:
|
2019-04-12 12:02:51 +01:00
|
|
|
_install_system_packages(session)
|
2020-05-19 07:56:26 +01:00
|
|
|
if crypto is None:
|
2020-04-27 09:09:05 +01:00
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements",
|
|
|
|
"static",
|
|
|
|
requirements_type,
|
|
|
|
pydir,
|
|
|
|
"{}-linux.txt".format(transport),
|
2019-10-07 18:29:02 +01:00
|
|
|
)
|
2020-04-27 09:09:05 +01:00
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements", "static", requirements_type, pydir, "linux.txt"
|
2019-10-28 13:55:06 +00:00
|
|
|
)
|
2020-04-27 09:09:05 +01:00
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
2020-05-19 07:56:26 +01:00
|
|
|
_requirements_file = os.path.join(
|
2021-02-25 09:43:44 +00:00
|
|
|
"requirements", "static", requirements_type, pydir, "linux-crypto.txt"
|
2020-05-19 07:56:26 +01:00
|
|
|
)
|
|
|
|
if os.path.exists(_requirements_file):
|
|
|
|
return _requirements_file
|
2021-09-13 11:11:35 +01:00
|
|
|
session.error("Could not find a linux requirements file for {}".format(pydir))
|
2019-03-16 19:00:01 +00:00
|
|
|
|
2019-10-07 18:29:02 +01:00
|
|
|
|
2021-09-22 12:57:30 +01:00
|
|
|
def _upgrade_pip_setuptools_and_wheel(session, upgrade=True):
|
2020-05-13 07:12:57 +01:00
|
|
|
if SKIP_REQUIREMENTS_INSTALL:
|
|
|
|
session.log(
|
|
|
|
"Skipping Python Requirements because SKIP_REQUIREMENTS_INSTALL was found in the environ"
|
|
|
|
)
|
2021-08-03 14:03:17 +01:00
|
|
|
return False
|
2020-08-31 17:56:16 +01:00
|
|
|
|
2021-02-25 07:02:15 +00:00
|
|
|
install_command = [
|
2021-02-25 14:32:02 +00:00
|
|
|
"python",
|
|
|
|
"-m",
|
|
|
|
"pip",
|
|
|
|
"install",
|
2021-02-25 07:02:15 +00:00
|
|
|
"--progress-bar=off",
|
|
|
|
]
|
2021-09-22 12:57:30 +01:00
|
|
|
if upgrade:
|
|
|
|
install_command.append("-U")
|
|
|
|
install_command.extend(
|
|
|
|
[
|
|
|
|
"pip>=20.2.4,<21.2",
|
2021-11-16 18:14:39 +00:00
|
|
|
"setuptools!=50.*,!=51.*,!=52.*,<59",
|
2021-09-22 12:57:30 +01:00
|
|
|
"wheel",
|
|
|
|
]
|
|
|
|
)
|
2021-02-25 14:32:02 +00:00
|
|
|
session.run(*install_command, silent=PIP_INSTALL_SILENT)
|
2021-08-03 14:03:17 +01:00
|
|
|
return True
|
2020-08-31 17:56:16 +01:00
|
|
|
|
2021-07-26 17:41:13 +01:00
|
|
|
|
|
|
|
def _install_requirements(
|
|
|
|
session, transport, *extra_requirements, requirements_type="ci"
|
|
|
|
):
|
2021-08-03 14:03:17 +01:00
|
|
|
if not _upgrade_pip_setuptools_and_wheel(session):
|
|
|
|
return
|
2021-07-26 17:41:13 +01:00
|
|
|
|
Merge 3003.3 into master (#60924)
* Merge 3002.6 bugfix changes (#59822)
* Pass `CI_RUN` as an environment variable to the test run.
This allows us to know if we're running the test suite under a CI
environment or not and adapt/adjust if needed
* Migrate `unit.setup` to PyTest
* Backport ae36b15 just for test_install.py
* Only skip tests on CI runs
* Always store git sha in _version.py during installation
* Fix PEP440 compliance.
The wheel metadata version 1.2 states that the package version MUST be
PEP440 compliant.
This means that instead of `3002.2-511-g033c53eccb`, the salt version
string should look like `3002.2+511.g033c53eccb`, a post release of
`3002.2` ahead by 511 commits with the git sha `033c53eccb`
* Fix and migrate `tests/unit/test_version.py` to PyTest
* Skip test if `easy_install` is not available
* We also need to be PEP440 compliant when there's no git history
* Allow extra_filerefs as sanitized kwargs for SSH client
* Fix regression on cmd.run when passing tuples as cmd
Co-authored-by: Alexander Graul <agraul@suse.com>
* Add unit tests to ensure cmd.run accepts tuples
* Add unit test to check for extra_filerefs on SSH opts
* Add changelog file
* Fix comment for test case
* Fix unit test to avoid failing on Windows
* Skip failing test on windows
* Fix test to work on Windows
* Add all ssh kwargs to sanitize_kwargs method
* Run pre-commit
* Fix pylint
* Fix cmdmod loglevel and module_names tests
* Fix pre-commit
* Skip ssh tests if binary does not exist
* Use setup_loader for cmdmod test
* Prevent argument injection in restartcheck
* Add changelog for restartcheck fix
* docs_3002.6
* Add back tests removed in merge
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>
* Remove glance state module in favor of glance_image
* update wording in changelog
* bump deprecation warning to Silicon.
* Updating warnutil version to Phosphorous.
* Update salt/modules/keystone.py
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
* Check $HOMEBREW_PREFIX when linking against libcrypto
When loading `libcrypto`, Salt checks for a Homebrew installation of `openssl`
at Homebrew's default prefix of `/usr/local`. However, on Apple Silicon Macs,
Homebrew's default installation prefix is `/opt/homebrew`. On all platforms,
the prefix is configurable. If Salt doesn't find one of those `libcrypto`s,
it will fall back on the un-versioned `/usr/lib/libcrypto.dylib`, which will
cause the following crash:
Application Specific Information:
/usr/lib/libcrypto.dylib
abort() called
Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.
This commit checks $HOMEBREW_PREFIX instead of hard-coding `/usr/local`.
* Add test case
* Add changelog for 59808
* Add changelog entry
* Make _find_libcrypto fail on Big Sur if it can't find a library
Right now, if `_find_libcrypto` can't find any externally-managed versions of
libcrypto, it will fall back on the pre-Catalina un-versioned system libcrypto.
This does not exist on Big Sur and it would be better to raise an exception
here rather than crashing later when trying to open it.
* Update _find_libcrypto tests
This commit simplifies the unit tests for _find_libcrypto by mocking out the
host's filesystem and testing the common libcrypto installations (brew, ports,
etc.) on Big Sur. It simplifies the tests for falling back on system versions
of libcrypto on previous versions of macOS.
* Fix description of test_find_libcrypto_with_system_before_catalina
* Patch sys.platform for test_rsax931 tests
* modules/match: add missing "minion_id" in Pillar example
The documented Pillar example for `match.filter_by` lacks the `minion_id` parameter. Without it, the assignment won't work as expected.
- fix documentation
- add tests:
- to prove the misbehavior of the documented example
- to prove the proper behaviour when supplying `minion_id`
- to ensure some misbehaviour observed with compound matchers doesn't occur
* Fix for issue #59773
- When instantiating the loader grab values of grains and pillars if
they are NamedLoaderContext instances.
- The loader uses a copy of opts.
- Impliment deepcopy on NamedLoaderContext instances.
* Add changelog for #59773
* _get_initial_pillar function returns pillar
* Fix linter issues
* Clean up test
* Bump deprecation release for neutron
* Uncomment Sulfur release name
* Removing the _ext_nodes deprecation warning and alias.
* Adding changelog.
* Renaming changelog file.
* Update 59804.removed
* Initial pass at fips_mode config option
* Fix pre-commit
* Fix tests and add changelog
* update docs 3003
* update docs 3003 - newline
* Fix warts in changelog
* update releasenotes 3003
* add ubuntu-2004-amd64 m2crypto pycryptodome and tcp tests
* add distro_arch
* changing the cloud platforms file missed in 1a9b7be0e2f300d87924731dc5816fd1000cd22b
* Update __utils__ calls to import utils in azure
* Add changelog for 59744
* Fix azure unit tests and move to pytest
* Use contextvars from site-packages for thin
If a contextvars package exists one of the site-packages locations use
it for the generated thin tarball. This overrides python's builtin
contextvars and allows salt-ssh to work with python <=3.6 even when the
master's python is >3.6 (Fixes #59942)
* Add regression test for #59942
* Add changelog for #59942
* Update filemap to include test_py_versions
* Fix broken thin tests
* Always install the `contextvars` backport, even on Py3.7+
Without this change, salt-ssh cannot target systems with Python <= 3.6
* Use salt-factories to handle the container. Don't override default roster
* Fix thin tests on windows
* No need to use warn log level here
* Fix getsitepackages for old virtualenv versions
* Add explicit pyobjc reqs
* Add back the passthrough stuff
* Remove a line so pre-commit will run
* Bugfix release docs
* Bugfix release docs
* Removing pip-compile log files
* Bump requirements to address a few security issues
* Address traceback on macOS
```
Traceback (most recent call last):
File "setup.py", line 1448, in <module>
setup(distclass=SaltDistribution)
File "/Users/jenkins/setup-tests/.venv/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/opt/salt/lib/python3.7/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "setup.py", line 1068, in __init__
self.update_metadata()
File "setup.py", line 1074, in update_metadata
attrvalue = getattr(self, attrname, None)
File "setup.py", line 1182, in _property_install_requires
install_requires += _parse_requirements_file(reqfile)
File "setup.py", line 270, in _parse_requirements_file
platform.python_version(), _parse_op(op), _parse_ver(ver)
File "setup.py", line 247, in _check_ver
return getattr(operator, "__{}__".format(op))(pyver, wanted)
File "/opt/salt/lib/python3.7/distutils/version.py", line 46, in __eq__
c = self._cmp(other)
File "/opt/salt/lib/python3.7/distutils/version.py", line 337, in _cmp
if self.version < other.version:
TypeError: '<' not supported between instances of 'str' and 'int'
```
* Replace `saltstack.com` with `saltproject.io` on URLs being tested
* Add back support to load old entrypoints by iterating instead of type checking
Fixes #59961
* Fix issue #59975
* Fix pillar serialization for jinja #60083
* Fix test
* Add changelog for #60083
* Update changelog and release for 3003.1
* Remove the changelog source refs
* Add connect to IPCMessageSubscriber's async_methods
Fixes #60049 by making sure an IPCMessageSubscriber that is wrapped by
SyncWrapper has a connect method that runs the coroutine rather than
returns a fugure.
* Add changelog for #60049
* Update 60049.fixed
* Fix coroutine spelling error
Co-authored-by: Wayne Werner <waynejwerner@gmail.com>
* IPC on windows cannot use socket paths
Fixes #60298
* Update Jinja2 and lxml due to security related bugfix releases
Jinja2
------
CVE-2020-28493
moderate severity
Vulnerable versions: < 2.11.3
Patched version: 2.11.3
This affects the package jinja2 from 0.0.0 and before 2.11.3. The ReDOS vulnerability of the regex is mainly due to the sub-pattern [a-zA-Z0-9.-]+.[a-zA-Z0-9.-]+ This issue can be mitigated by Markdown to format user content instead of the urlize filter, or by implementing request timeouts and limiting process memory.
lxml
----
CVE-2021-28957
moderate severity
Vulnerable versions: < 4.6.3
Patched version: 4.6.3
An XSS vulnerability was discovered in the python lxml clean module versions before 4.6.3. When disabling the safe_attrs_only and forms arguments, the Cleaner class does not remove the formaction attribute allowing for JS to bypass the sanitizer. A remote attacker could exploit this flaw to run arbitrary JS code on users who interact with incorrectly sanitized HTML. This issue is patched in lxml 4.6.3.
* fix github actions jobs on branch until bullseye comes out
* Upgrade to `six==1.16.0` to avoid problems on CI runs
```
13:59:02 nox > Session invoke-pre-commit was successful.
13:59:02 nox > Running session invoke-pre-commit
13:59:02 nox > pip install --progress-bar=off -r requirements/static/ci/py3.7/invoke.txt
13:59:02 Collecting blessings==1.7
13:59:02 Using cached blessings-1.7-py3-none-any.whl (18 kB)
13:59:02 Collecting invoke==1.4.1
13:59:02 Using cached invoke-1.4.1-py3-none-any.whl (210 kB)
13:59:02 Collecting pyyaml==5.3.1
13:59:02 Using cached PyYAML-5.3.1.tar.gz (269 kB)
13:59:02 Collecting six==1.15.0
13:59:02 Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
13:59:02 Building wheels for collected packages: pyyaml
13:59:02 Building wheel for pyyaml (setup.py) ... - \ | / - \ | done
13:59:02 Created wheel for pyyaml: filename=PyYAML-5.3.1-cp37-cp37m-linux_x86_64.whl size=546391 sha256=e42e1d66cc32087f4d33ceb81268c86b59f1a97029b19459f91b8d6ad1430167
13:59:02 Stored in directory: /var/jenkins/.cache/pip/wheels/5e/03/1e/e1e954795d6f35dfc7b637fe2277bff021303bd9570ecea653
13:59:02 Successfully built pyyaml
13:59:02 Installing collected packages: six, pyyaml, invoke, blessings
13:59:02 Attempting uninstall: six
13:59:02 Found existing installation: six 1.16.0
13:59:02 Uninstalling six-1.16.0:
13:59:02 ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/var/jenkins/.cache/pre-commit/repomw8oee1s/py_env-python3/lib/python3.7/site-packages/__pycache__/six.cpython-37.pyc'
13:59:02
13:59:02 nox > Command pip install --progress-bar=off -r requirements/static/ci/py3.7/invoke.txt failed with exit code 1
13:59:02 nox > Session invoke-pre-commit failed.
```
* add changelog for https://github.com/saltstack/salt/issues/59982
* Regression test for #56273
* Fix race condition in batch. #56273
* Add changelog for #56273
* Update salt/client/__init__.py
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
* Update doc for salt/client
* Update changelog/56273.fixed
Thoreau said, "Simplify, Simplify"
* Update docs
* Update docs
* Update CHANGELOG.md
* Update 3003.1.rst
* Ignore configuration for 'enable_fqdns_grains' for AIX, Solaris and Juniper
* Added changelog
* Let Mac OS Mojave run for 8 hours to avoid timeout
* Remove FreeBSD-12.2
* Use Popen for VT
* Still allow shell True
* Drop shlex split
* Add crypto re-init
* Fix pre-commit
* Do not call close in isalive
* Skip tests not valid on windows
* Cleanup things that are not really needed
* We do not support irix
* Fix pre-commit
* Remove commented out lines
* Add changelog for #60504
* Fix pre-commit issues
* pyupgrade does not remove six imports
* Fix OSErrors in some test cases
* Remove un-needed args processing
* Make state_running test more reliable
* Removing tmpfs from Fedora 33.
* Address leaks in fileserver caused by git backends
At this time we do not have the ability to fix the upstream memory leaks
in the gitfs backend providers. Work around their limitations by
periodically restarting the file server update proccess. This will at
least partially address #50313
* Remove un-used import
* Fix warts caused by black version
* Add changelog
* We don't need two changelogs
* Also pin the ``pip`` upgrade to be ``<21.2``
* Update the external ipaddress to the latest 3.9.5 version which has some security fixes. Updating the compat.p to use the vendored version if the python version is below 3.9.5 and only run the test_ipaddress.py tests if below 3.9.5.
* Adding changelog
* Requested changes.
* Add shh_timeout to ssh_kwargs
* move to with blocks
* one with block
* reight crypto
* add back test file
* add changelog
* change log file number
* add m2crypt support
* only check m2crpto
* Delete 60571.fixed
* add back log
* add newline
* add newline for log file
* Work around https://github.com/pypa/pip/pull/9450
See https://github.com/pypa/pip/issues/10212
* Drop six and Py2
* [3003.2] Add server alive (#60573)
* add server alive
* rename log
* change default alive time
* add requested changes
* format string
* reformat string again
* run pre
* customize
* space
* remove EOF dead space
* fix pre-commit
* run pre
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
* Changelog for 3003.2
* Man pages update for 3003.2
* Allow CVE entries in `changelog/`
* Add security type for towncrier changelog
* Add security type for changelog entries pre-commit check
* Pin to ``pip>=20.2.4,<21.2``
Refs https://github.com/pypa/pip/pull/9450
* Drop six and Py2
* Fix bug introduced in https://github.com/saltstack/salt/pull/59648
Fixes #60046
* Add changelog
* Fix doc builds
* fix release notes about dropping ubuntu 16.04
* update file client
* add changelog file
* update changelog
* Check permissions of minion config directory
* Fix some wording in the messagebox and in comments
* Add changelog
* Fix extension for changelog
* Add missing commas. It also worked, but now is better
* docs_3003.3
* fixing version numbers in man pages.
* removing newlines.
* removing newlines.
* Fixing release notes.
* Fix changelog file for 3003.2 release
* Fix test_state test using loader.context
* Re-add test_context test
* Allow Local System account, add timestamp
* swaping the git-source for vsphere-automation-sdk-python
* Remove destroy, handled in context manager
Co-authored-by: Daniel Wozniak <dwozniak@saltstack.com>
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@wiked.org>
Co-authored-by: Hoa-Long Tam <hoalong@apple.com>
Co-authored-by: krionbsd <krion@freebsd.org>
Co-authored-by: Elias Probst <e.probst@ssc-services.de>
Co-authored-by: Daniel A. Wozniak <dwozniak@vmware.com>
Co-authored-by: Frode Gundersen <frogunder@gmail.com>
Co-authored-by: twangboy <slee@saltstack.com>
Co-authored-by: twangboy <leesh@vmware.com>
Co-authored-by: ScriptAutomate <derek@icanteven.io>
Co-authored-by: Wayne Werner <waynejwerner@gmail.com>
Co-authored-by: David Murphy < dmurphy@saltstack.com>
Co-authored-by: Joe Eacott <jeacott@vmware.com>
Co-authored-by: cmcmarrow <charles.mcmarrow.4@gmail.com>
Co-authored-by: Twangboy <shane.d.lee@gmail.com>
2021-09-22 20:42:38 -04:00
|
|
|
|
|
|
|
def _install_requirements(
|
|
|
|
session, transport, *extra_requirements, requirements_type="ci"
|
|
|
|
):
|
|
|
|
if not _upgrade_pip_setuptools_and_wheel(session):
|
|
|
|
return False
|
|
|
|
|
2019-10-07 18:29:02 +01:00
|
|
|
# Install requirements
|
2021-02-25 09:43:44 +00:00
|
|
|
requirements_file = _get_pip_requirements_file(
|
|
|
|
session, transport, requirements_type=requirements_type
|
|
|
|
)
|
2020-09-01 19:38:37 +01:00
|
|
|
install_command = ["--progress-bar=off", "-r", requirements_file]
|
2020-04-27 09:09:05 +01:00
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
2019-02-20 16:40:10 +00:00
|
|
|
|
|
|
|
if extra_requirements:
|
2020-09-01 19:38:37 +01:00
|
|
|
install_command = ["--progress-bar=off"]
|
2019-10-07 18:29:02 +01:00
|
|
|
install_command += list(extra_requirements)
|
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
2019-02-20 16:40:10 +00:00
|
|
|
|
2020-05-19 06:54:53 +01:00
|
|
|
if EXTRA_REQUIREMENTS_INSTALL:
|
|
|
|
session.log(
|
2021-08-03 08:40:21 +01:00
|
|
|
"Installing the following extra requirements because the"
|
|
|
|
" EXTRA_REQUIREMENTS_INSTALL environment variable was set: %s",
|
2020-05-19 06:54:53 +01:00
|
|
|
EXTRA_REQUIREMENTS_INSTALL,
|
|
|
|
)
|
|
|
|
# We pass --constraint in this step because in case any of these extra dependencies has a requirement
|
|
|
|
# we're already using, we want to maintain the locked version
|
|
|
|
install_command = ["--progress-bar=off", "--constraint", requirements_file]
|
|
|
|
install_command += EXTRA_REQUIREMENTS_INSTALL.split()
|
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
|
|
|
|
Merge 3003.3 into master (#60924)
* Merge 3002.6 bugfix changes (#59822)
* Pass `CI_RUN` as an environment variable to the test run.
This allows us to know if we're running the test suite under a CI
environment or not and adapt/adjust if needed
* Migrate `unit.setup` to PyTest
* Backport ae36b15 just for test_install.py
* Only skip tests on CI runs
* Always store git sha in _version.py during installation
* Fix PEP440 compliance.
The wheel metadata version 1.2 states that the package version MUST be
PEP440 compliant.
This means that instead of `3002.2-511-g033c53eccb`, the salt version
string should look like `3002.2+511.g033c53eccb`, a post release of
`3002.2` ahead by 511 commits with the git sha `033c53eccb`
* Fix and migrate `tests/unit/test_version.py` to PyTest
* Skip test if `easy_install` is not available
* We also need to be PEP440 compliant when there's no git history
* Allow extra_filerefs as sanitized kwargs for SSH client
* Fix regression on cmd.run when passing tuples as cmd
Co-authored-by: Alexander Graul <agraul@suse.com>
* Add unit tests to ensure cmd.run accepts tuples
* Add unit test to check for extra_filerefs on SSH opts
* Add changelog file
* Fix comment for test case
* Fix unit test to avoid failing on Windows
* Skip failing test on windows
* Fix test to work on Windows
* Add all ssh kwargs to sanitize_kwargs method
* Run pre-commit
* Fix pylint
* Fix cmdmod loglevel and module_names tests
* Fix pre-commit
* Skip ssh tests if binary does not exist
* Use setup_loader for cmdmod test
* Prevent argument injection in restartcheck
* Add changelog for restartcheck fix
* docs_3002.6
* Add back tests removed in merge
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>
* Remove glance state module in favor of glance_image
* update wording in changelog
* bump deprecation warning to Silicon.
* Updating warnutil version to Phosphorous.
* Update salt/modules/keystone.py
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
* Check $HOMEBREW_PREFIX when linking against libcrypto
When loading `libcrypto`, Salt checks for a Homebrew installation of `openssl`
at Homebrew's default prefix of `/usr/local`. However, on Apple Silicon Macs,
Homebrew's default installation prefix is `/opt/homebrew`. On all platforms,
the prefix is configurable. If Salt doesn't find one of those `libcrypto`s,
it will fall back on the un-versioned `/usr/lib/libcrypto.dylib`, which will
cause the following crash:
Application Specific Information:
/usr/lib/libcrypto.dylib
abort() called
Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.
This commit checks $HOMEBREW_PREFIX instead of hard-coding `/usr/local`.
* Add test case
* Add changelog for 59808
* Add changelog entry
* Make _find_libcrypto fail on Big Sur if it can't find a library
Right now, if `_find_libcrypto` can't find any externally-managed versions of
libcrypto, it will fall back on the pre-Catalina un-versioned system libcrypto.
This does not exist on Big Sur and it would be better to raise an exception
here rather than crashing later when trying to open it.
* Update _find_libcrypto tests
This commit simplifies the unit tests for _find_libcrypto by mocking out the
host's filesystem and testing the common libcrypto installations (brew, ports,
etc.) on Big Sur. It simplifies the tests for falling back on system versions
of libcrypto on previous versions of macOS.
* Fix description of test_find_libcrypto_with_system_before_catalina
* Patch sys.platform for test_rsax931 tests
* modules/match: add missing "minion_id" in Pillar example
The documented Pillar example for `match.filter_by` lacks the `minion_id` parameter. Without it, the assignment won't work as expected.
- fix documentation
- add tests:
- to prove the misbehavior of the documented example
- to prove the proper behaviour when supplying `minion_id`
- to ensure some misbehaviour observed with compound matchers doesn't occur
* Fix for issue #59773
- When instantiating the loader grab values of grains and pillars if
they are NamedLoaderContext instances.
- The loader uses a copy of opts.
- Impliment deepcopy on NamedLoaderContext instances.
* Add changelog for #59773
* _get_initial_pillar function returns pillar
* Fix linter issues
* Clean up test
* Bump deprecation release for neutron
* Uncomment Sulfur release name
* Removing the _ext_nodes deprecation warning and alias.
* Adding changelog.
* Renaming changelog file.
* Update 59804.removed
* Initial pass at fips_mode config option
* Fix pre-commit
* Fix tests and add changelog
* update docs 3003
* update docs 3003 - newline
* Fix warts in changelog
* update releasenotes 3003
* add ubuntu-2004-amd64 m2crypto pycryptodome and tcp tests
* add distro_arch
* changing the cloud platforms file missed in 1a9b7be0e2f300d87924731dc5816fd1000cd22b
* Update __utils__ calls to import utils in azure
* Add changelog for 59744
* Fix azure unit tests and move to pytest
* Use contextvars from site-packages for thin
If a contextvars package exists one of the site-packages locations use
it for the generated thin tarball. This overrides python's builtin
contextvars and allows salt-ssh to work with python <=3.6 even when the
master's python is >3.6 (Fixes #59942)
* Add regression test for #59942
* Add changelog for #59942
* Update filemap to include test_py_versions
* Fix broken thin tests
* Always install the `contextvars` backport, even on Py3.7+
Without this change, salt-ssh cannot target systems with Python <= 3.6
* Use salt-factories to handle the container. Don't override default roster
* Fix thin tests on windows
* No need to use warn log level here
* Fix getsitepackages for old virtualenv versions
* Add explicit pyobjc reqs
* Add back the passthrough stuff
* Remove a line so pre-commit will run
* Bugfix release docs
* Bugfix release docs
* Removing pip-compile log files
* Bump requirements to address a few security issues
* Address traceback on macOS
```
Traceback (most recent call last):
File "setup.py", line 1448, in <module>
setup(distclass=SaltDistribution)
File "/Users/jenkins/setup-tests/.venv/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/opt/salt/lib/python3.7/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "setup.py", line 1068, in __init__
self.update_metadata()
File "setup.py", line 1074, in update_metadata
attrvalue = getattr(self, attrname, None)
File "setup.py", line 1182, in _property_install_requires
install_requires += _parse_requirements_file(reqfile)
File "setup.py", line 270, in _parse_requirements_file
platform.python_version(), _parse_op(op), _parse_ver(ver)
File "setup.py", line 247, in _check_ver
return getattr(operator, "__{}__".format(op))(pyver, wanted)
File "/opt/salt/lib/python3.7/distutils/version.py", line 46, in __eq__
c = self._cmp(other)
File "/opt/salt/lib/python3.7/distutils/version.py", line 337, in _cmp
if self.version < other.version:
TypeError: '<' not supported between instances of 'str' and 'int'
```
* Replace `saltstack.com` with `saltproject.io` on URLs being tested
* Add back support to load old entrypoints by iterating instead of type checking
Fixes #59961
* Fix issue #59975
* Fix pillar serialization for jinja #60083
* Fix test
* Add changelog for #60083
* Update changelog and release for 3003.1
* Remove the changelog source refs
* Add connect to IPCMessageSubscriber's async_methods
Fixes #60049 by making sure an IPCMessageSubscriber that is wrapped by
SyncWrapper has a connect method that runs the coroutine rather than
returns a fugure.
* Add changelog for #60049
* Update 60049.fixed
* Fix coroutine spelling error
Co-authored-by: Wayne Werner <waynejwerner@gmail.com>
* IPC on windows cannot use socket paths
Fixes #60298
* Update Jinja2 and lxml due to security related bugfix releases
Jinja2
------
CVE-2020-28493
moderate severity
Vulnerable versions: < 2.11.3
Patched version: 2.11.3
This affects the package jinja2 from 0.0.0 and before 2.11.3. The ReDOS vulnerability of the regex is mainly due to the sub-pattern [a-zA-Z0-9.-]+.[a-zA-Z0-9.-]+ This issue can be mitigated by Markdown to format user content instead of the urlize filter, or by implementing request timeouts and limiting process memory.
lxml
----
CVE-2021-28957
moderate severity
Vulnerable versions: < 4.6.3
Patched version: 4.6.3
An XSS vulnerability was discovered in the python lxml clean module versions before 4.6.3. When disabling the safe_attrs_only and forms arguments, the Cleaner class does not remove the formaction attribute allowing for JS to bypass the sanitizer. A remote attacker could exploit this flaw to run arbitrary JS code on users who interact with incorrectly sanitized HTML. This issue is patched in lxml 4.6.3.
* fix github actions jobs on branch until bullseye comes out
* Upgrade to `six==1.16.0` to avoid problems on CI runs
```
13:59:02 nox > Session invoke-pre-commit was successful.
13:59:02 nox > Running session invoke-pre-commit
13:59:02 nox > pip install --progress-bar=off -r requirements/static/ci/py3.7/invoke.txt
13:59:02 Collecting blessings==1.7
13:59:02 Using cached blessings-1.7-py3-none-any.whl (18 kB)
13:59:02 Collecting invoke==1.4.1
13:59:02 Using cached invoke-1.4.1-py3-none-any.whl (210 kB)
13:59:02 Collecting pyyaml==5.3.1
13:59:02 Using cached PyYAML-5.3.1.tar.gz (269 kB)
13:59:02 Collecting six==1.15.0
13:59:02 Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
13:59:02 Building wheels for collected packages: pyyaml
13:59:02 Building wheel for pyyaml (setup.py) ... - \ | / - \ | done
13:59:02 Created wheel for pyyaml: filename=PyYAML-5.3.1-cp37-cp37m-linux_x86_64.whl size=546391 sha256=e42e1d66cc32087f4d33ceb81268c86b59f1a97029b19459f91b8d6ad1430167
13:59:02 Stored in directory: /var/jenkins/.cache/pip/wheels/5e/03/1e/e1e954795d6f35dfc7b637fe2277bff021303bd9570ecea653
13:59:02 Successfully built pyyaml
13:59:02 Installing collected packages: six, pyyaml, invoke, blessings
13:59:02 Attempting uninstall: six
13:59:02 Found existing installation: six 1.16.0
13:59:02 Uninstalling six-1.16.0:
13:59:02 ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/var/jenkins/.cache/pre-commit/repomw8oee1s/py_env-python3/lib/python3.7/site-packages/__pycache__/six.cpython-37.pyc'
13:59:02
13:59:02 nox > Command pip install --progress-bar=off -r requirements/static/ci/py3.7/invoke.txt failed with exit code 1
13:59:02 nox > Session invoke-pre-commit failed.
```
* add changelog for https://github.com/saltstack/salt/issues/59982
* Regression test for #56273
* Fix race condition in batch. #56273
* Add changelog for #56273
* Update salt/client/__init__.py
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
* Update doc for salt/client
* Update changelog/56273.fixed
Thoreau said, "Simplify, Simplify"
* Update docs
* Update docs
* Update CHANGELOG.md
* Update 3003.1.rst
* Ignore configuration for 'enable_fqdns_grains' for AIX, Solaris and Juniper
* Added changelog
* Let Mac OS Mojave run for 8 hours to avoid timeout
* Remove FreeBSD-12.2
* Use Popen for VT
* Still allow shell True
* Drop shlex split
* Add crypto re-init
* Fix pre-commit
* Do not call close in isalive
* Skip tests not valid on windows
* Cleanup things that are not really needed
* We do not support irix
* Fix pre-commit
* Remove commented out lines
* Add changelog for #60504
* Fix pre-commit issues
* pyupgrade does not remove six imports
* Fix OSErrors in some test cases
* Remove un-needed args processing
* Make state_running test more reliable
* Removing tmpfs from Fedora 33.
* Address leaks in fileserver caused by git backends
At this time we do not have the ability to fix the upstream memory leaks
in the gitfs backend providers. Work around their limitations by
periodically restarting the file server update proccess. This will at
least partially address #50313
* Remove un-used import
* Fix warts caused by black version
* Add changelog
* We don't need two changelogs
* Also pin the ``pip`` upgrade to be ``<21.2``
* Update the external ipaddress to the latest 3.9.5 version which has some security fixes. Updating the compat.p to use the vendored version if the python version is below 3.9.5 and only run the test_ipaddress.py tests if below 3.9.5.
* Adding changelog
* Requested changes.
* Add shh_timeout to ssh_kwargs
* move to with blocks
* one with block
* reight crypto
* add back test file
* add changelog
* change log file number
* add m2crypt support
* only check m2crpto
* Delete 60571.fixed
* add back log
* add newline
* add newline for log file
* Work around https://github.com/pypa/pip/pull/9450
See https://github.com/pypa/pip/issues/10212
* Drop six and Py2
* [3003.2] Add server alive (#60573)
* add server alive
* rename log
* change default alive time
* add requested changes
* format string
* reformat string again
* run pre
* customize
* space
* remove EOF dead space
* fix pre-commit
* run pre
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
* Changelog for 3003.2
* Man pages update for 3003.2
* Allow CVE entries in `changelog/`
* Add security type for towncrier changelog
* Add security type for changelog entries pre-commit check
* Pin to ``pip>=20.2.4,<21.2``
Refs https://github.com/pypa/pip/pull/9450
* Drop six and Py2
* Fix bug introduced in https://github.com/saltstack/salt/pull/59648
Fixes #60046
* Add changelog
* Fix doc builds
* fix release notes about dropping ubuntu 16.04
* update file client
* add changelog file
* update changelog
* Check permissions of minion config directory
* Fix some wording in the messagebox and in comments
* Add changelog
* Fix extension for changelog
* Add missing commas. It also worked, but now is better
* docs_3003.3
* fixing version numbers in man pages.
* removing newlines.
* removing newlines.
* Fixing release notes.
* Fix changelog file for 3003.2 release
* Fix test_state test using loader.context
* Re-add test_context test
* Allow Local System account, add timestamp
* swaping the git-source for vsphere-automation-sdk-python
* Remove destroy, handled in context manager
Co-authored-by: Daniel Wozniak <dwozniak@saltstack.com>
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@wiked.org>
Co-authored-by: Hoa-Long Tam <hoalong@apple.com>
Co-authored-by: krionbsd <krion@freebsd.org>
Co-authored-by: Elias Probst <e.probst@ssc-services.de>
Co-authored-by: Daniel A. Wozniak <dwozniak@vmware.com>
Co-authored-by: Frode Gundersen <frogunder@gmail.com>
Co-authored-by: twangboy <slee@saltstack.com>
Co-authored-by: twangboy <leesh@vmware.com>
Co-authored-by: ScriptAutomate <derek@icanteven.io>
Co-authored-by: Wayne Werner <waynejwerner@gmail.com>
Co-authored-by: David Murphy < dmurphy@saltstack.com>
Co-authored-by: Joe Eacott <jeacott@vmware.com>
Co-authored-by: cmcmarrow <charles.mcmarrow.4@gmail.com>
Co-authored-by: Twangboy <shane.d.lee@gmail.com>
2021-09-22 20:42:38 -04:00
|
|
|
return True
|
|
|
|
|
2019-02-20 16:40:10 +00:00
|
|
|
|
2020-09-14 18:29:48 +01:00
|
|
|
def _run_with_coverage(session, *test_cmd, env=None):
|
2020-05-13 07:12:57 +01:00
|
|
|
if SKIP_REQUIREMENTS_INSTALL is False:
|
|
|
|
session.install(
|
2020-07-09 12:26:05 +01:00
|
|
|
"--progress-bar=off", "coverage==5.2", silent=PIP_INSTALL_SILENT
|
2020-05-13 07:12:57 +01:00
|
|
|
)
|
2019-02-20 16:40:10 +00:00
|
|
|
session.run("coverage", "erase")
|
|
|
|
python_path_env_var = os.environ.get("PYTHONPATH") or None
|
|
|
|
if python_path_env_var is None:
|
|
|
|
python_path_env_var = SITECUSTOMIZE_DIR
|
|
|
|
else:
|
2019-04-20 13:25:45 +01:00
|
|
|
python_path_entries = python_path_env_var.split(os.pathsep)
|
|
|
|
if SITECUSTOMIZE_DIR in python_path_entries:
|
|
|
|
python_path_entries.remove(SITECUSTOMIZE_DIR)
|
|
|
|
python_path_entries.insert(0, SITECUSTOMIZE_DIR)
|
|
|
|
python_path_env_var = os.pathsep.join(python_path_entries)
|
2019-11-12 17:25:30 +00:00
|
|
|
|
2020-09-14 18:29:48 +01:00
|
|
|
if env is None:
|
|
|
|
env = {}
|
|
|
|
|
|
|
|
env.update(
|
|
|
|
{
|
|
|
|
# The updated python path so that sitecustomize is importable
|
|
|
|
"PYTHONPATH": python_path_env_var,
|
|
|
|
# The full path to the .coverage data file. Makes sure we always write
|
|
|
|
# them to the same directory
|
|
|
|
"COVERAGE_FILE": os.path.abspath(os.path.join(REPO_ROOT, ".coverage")),
|
|
|
|
# Instruct sub processes to also run under coverage
|
|
|
|
"COVERAGE_PROCESS_START": os.path.join(REPO_ROOT, ".coveragerc"),
|
|
|
|
}
|
|
|
|
)
|
2019-11-12 17:25:30 +00:00
|
|
|
|
2019-04-20 11:53:27 +01:00
|
|
|
try:
|
2019-11-12 17:25:30 +00:00
|
|
|
session.run(*test_cmd, env=env)
|
2019-04-20 11:53:27 +01:00
|
|
|
finally:
|
|
|
|
# Always combine and generate the XML coverage report
|
2019-07-11 17:09:24 +01:00
|
|
|
try:
|
|
|
|
session.run("coverage", "combine")
|
|
|
|
except CommandFailed:
|
|
|
|
# Sometimes some of the coverage files are corrupt which would trigger a CommandFailed
|
|
|
|
# exception
|
|
|
|
pass
|
2019-10-23 14:58:59 +01:00
|
|
|
# Generate report for salt code coverage
|
|
|
|
session.run(
|
|
|
|
"coverage",
|
|
|
|
"xml",
|
2019-10-31 10:14:36 +00:00
|
|
|
"-o",
|
|
|
|
os.path.join("artifacts", "coverage", "salt.xml"),
|
2019-10-23 14:58:59 +01:00
|
|
|
"--omit=tests/*",
|
|
|
|
"--include=salt/*",
|
|
|
|
)
|
|
|
|
# Generate report for tests code coverage
|
|
|
|
session.run(
|
|
|
|
"coverage",
|
|
|
|
"xml",
|
2019-10-31 10:14:36 +00:00
|
|
|
"-o",
|
|
|
|
os.path.join("artifacts", "coverage", "tests.xml"),
|
2019-10-23 14:58:59 +01:00
|
|
|
"--omit=salt/*",
|
|
|
|
"--include=tests/*",
|
|
|
|
)
|
2020-05-20 14:20:37 +01:00
|
|
|
# Move the coverage DB to artifacts/coverage in order for it to be archived by CI
|
|
|
|
shutil.move(".coverage", os.path.join("artifacts", "coverage", ".coverage"))
|
2019-02-20 16:40:10 +00:00
|
|
|
|
|
|
|
|
2020-09-03 09:56:33 +01:00
|
|
|
def _runtests(session):
|
|
|
|
session.error(
|
|
|
|
"""\n\nruntests.py support has been removed from Salt. Please try `nox -e '{0}'` """
|
|
|
|
"""or `nox -e '{0}' -- --help` to know more about the supported CLI flags.\n"""
|
|
|
|
"For more information, please check "
|
|
|
|
"https://docs.saltproject.io/en/latest/topics/development/tests/index.html#running-the-tests\n..".format(
|
|
|
|
session._runner.global_config.sessions[0].replace("runtests", "pytest")
|
2019-03-22 17:27:01 +00:00
|
|
|
)
|
2020-09-03 09:56:33 +01:00
|
|
|
)
|
2019-02-20 16:40:10 +00:00
|
|
|
|
|
|
|
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-parametrized")
|
2019-03-25 15:07:39 +00:00
|
|
|
@nox.parametrize("coverage", [False, True])
|
2019-10-07 17:56:46 +01:00
|
|
|
@nox.parametrize("transport", ["zeromq", "tcp"])
|
2020-04-23 09:32:34 +01:00
|
|
|
@nox.parametrize("crypto", [None, "m2crypto", "pycryptodome"])
|
2019-03-25 17:49:33 +00:00
|
|
|
def runtests_parametrized(session, coverage, transport, crypto):
|
2020-06-08 09:14:07 +01:00
|
|
|
"""
|
|
|
|
DO NOT CALL THIS NOX SESSION DIRECTLY
|
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-03-25 15:07:39 +00:00
|
|
|
|
|
|
|
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS)
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def runtests(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
runtests.py session with zeromq transport and default crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-03-25 15:07:39 +00:00
|
|
|
|
|
|
|
|
2019-04-05 15:57:30 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-tcp")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def runtests_tcp(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-05 15:57:30 +01:00
|
|
|
runtests.py session with TCP transport and default crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-04-05 15:57:30 +01:00
|
|
|
|
|
|
|
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-zeromq")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def runtests_zeromq(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
runtests.py session with zeromq transport and default crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-03-25 17:49:33 +00:00
|
|
|
|
|
|
|
|
2019-03-25 15:07:39 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-m2crypto")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
2019-03-25 17:49:33 +00:00
|
|
|
def runtests_m2crypto(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
runtests.py session with zeromq transport and m2crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-03-25 17:49:33 +00:00
|
|
|
|
|
|
|
|
2019-04-05 15:57:30 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-tcp-m2crypto")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def runtests_tcp_m2crypto(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-05 15:57:30 +01:00
|
|
|
runtests.py session with TCP transport and m2crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-04-05 15:57:30 +01:00
|
|
|
|
|
|
|
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-zeromq-m2crypto")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def runtests_zeromq_m2crypto(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
runtests.py session with zeromq transport and m2crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-03-25 17:49:33 +00:00
|
|
|
|
|
|
|
|
2020-04-23 09:32:34 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-pycryptodome")
|
2019-03-25 15:07:39 +00:00
|
|
|
@nox.parametrize("coverage", [False, True])
|
2020-04-23 09:32:34 +01:00
|
|
|
def runtests_pycryptodome(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-04-23 09:32:34 +01:00
|
|
|
runtests.py session with zeromq transport and pycryptodome
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-03-25 15:07:39 +00:00
|
|
|
|
|
|
|
|
2020-04-23 09:32:34 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-tcp-pycryptodome")
|
2019-04-05 15:57:30 +01:00
|
|
|
@nox.parametrize("coverage", [False, True])
|
2020-04-23 09:32:34 +01:00
|
|
|
def runtests_tcp_pycryptodome(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-04-23 09:32:34 +01:00
|
|
|
runtests.py session with TCP transport and pycryptodome
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-04-05 15:57:30 +01:00
|
|
|
|
|
|
|
|
2020-04-23 09:32:34 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-zeromq-pycryptodome")
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.parametrize("coverage", [False, True])
|
2020-04-23 09:32:34 +01:00
|
|
|
def runtests_zeromq_pycryptodome(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-04-23 09:32:34 +01:00
|
|
|
runtests.py session with zeromq transport and pycryptodome
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-03-25 17:49:33 +00:00
|
|
|
|
|
|
|
|
2019-04-18 18:48:42 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-cloud")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def runtests_cloud(session, coverage):
|
2020-06-08 09:14:07 +01:00
|
|
|
"""
|
|
|
|
runtests.py cloud tests session
|
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-04-18 18:48:42 +01:00
|
|
|
|
|
|
|
|
2019-04-18 18:52:27 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="runtests-tornado")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def runtests_tornado(session, coverage):
|
2020-06-08 09:14:07 +01:00
|
|
|
"""
|
|
|
|
runtests.py tornado tests session
|
|
|
|
"""
|
2020-09-03 09:56:33 +01:00
|
|
|
_runtests(session)
|
2019-04-18 18:52:27 +01:00
|
|
|
|
|
|
|
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-parametrized")
|
2019-02-20 16:40:10 +00:00
|
|
|
@nox.parametrize("coverage", [False, True])
|
2019-10-07 17:56:46 +01:00
|
|
|
@nox.parametrize("transport", ["zeromq", "tcp"])
|
2020-04-23 09:32:34 +01:00
|
|
|
@nox.parametrize("crypto", [None, "m2crypto", "pycryptodome"])
|
2019-03-25 17:49:33 +00:00
|
|
|
def pytest_parametrized(session, coverage, transport, crypto):
|
2020-06-08 09:14:07 +01:00
|
|
|
"""
|
|
|
|
DO NOT CALL THIS NOX SESSION DIRECTLY
|
|
|
|
"""
|
2019-02-20 16:40:10 +00:00
|
|
|
# Install requirements
|
Merge 3003.3 into master (#60924)
* Merge 3002.6 bugfix changes (#59822)
* Pass `CI_RUN` as an environment variable to the test run.
This allows us to know if we're running the test suite under a CI
environment or not and adapt/adjust if needed
* Migrate `unit.setup` to PyTest
* Backport ae36b15 just for test_install.py
* Only skip tests on CI runs
* Always store git sha in _version.py during installation
* Fix PEP440 compliance.
The wheel metadata version 1.2 states that the package version MUST be
PEP440 compliant.
This means that instead of `3002.2-511-g033c53eccb`, the salt version
string should look like `3002.2+511.g033c53eccb`, a post release of
`3002.2` ahead by 511 commits with the git sha `033c53eccb`
* Fix and migrate `tests/unit/test_version.py` to PyTest
* Skip test if `easy_install` is not available
* We also need to be PEP440 compliant when there's no git history
* Allow extra_filerefs as sanitized kwargs for SSH client
* Fix regression on cmd.run when passing tuples as cmd
Co-authored-by: Alexander Graul <agraul@suse.com>
* Add unit tests to ensure cmd.run accepts tuples
* Add unit test to check for extra_filerefs on SSH opts
* Add changelog file
* Fix comment for test case
* Fix unit test to avoid failing on Windows
* Skip failing test on windows
* Fix test to work on Windows
* Add all ssh kwargs to sanitize_kwargs method
* Run pre-commit
* Fix pylint
* Fix cmdmod loglevel and module_names tests
* Fix pre-commit
* Skip ssh tests if binary does not exist
* Use setup_loader for cmdmod test
* Prevent argument injection in restartcheck
* Add changelog for restartcheck fix
* docs_3002.6
* Add back tests removed in merge
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>
* Remove glance state module in favor of glance_image
* update wording in changelog
* bump deprecation warning to Silicon.
* Updating warnutil version to Phosphorous.
* Update salt/modules/keystone.py
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
* Check $HOMEBREW_PREFIX when linking against libcrypto
When loading `libcrypto`, Salt checks for a Homebrew installation of `openssl`
at Homebrew's default prefix of `/usr/local`. However, on Apple Silicon Macs,
Homebrew's default installation prefix is `/opt/homebrew`. On all platforms,
the prefix is configurable. If Salt doesn't find one of those `libcrypto`s,
it will fall back on the un-versioned `/usr/lib/libcrypto.dylib`, which will
cause the following crash:
Application Specific Information:
/usr/lib/libcrypto.dylib
abort() called
Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.
This commit checks $HOMEBREW_PREFIX instead of hard-coding `/usr/local`.
* Add test case
* Add changelog for 59808
* Add changelog entry
* Make _find_libcrypto fail on Big Sur if it can't find a library
Right now, if `_find_libcrypto` can't find any externally-managed versions of
libcrypto, it will fall back on the pre-Catalina un-versioned system libcrypto.
This does not exist on Big Sur and it would be better to raise an exception
here rather than crashing later when trying to open it.
* Update _find_libcrypto tests
This commit simplifies the unit tests for _find_libcrypto by mocking out the
host's filesystem and testing the common libcrypto installations (brew, ports,
etc.) on Big Sur. It simplifies the tests for falling back on system versions
of libcrypto on previous versions of macOS.
* Fix description of test_find_libcrypto_with_system_before_catalina
* Patch sys.platform for test_rsax931 tests
* modules/match: add missing "minion_id" in Pillar example
The documented Pillar example for `match.filter_by` lacks the `minion_id` parameter. Without it, the assignment won't work as expected.
- fix documentation
- add tests:
- to prove the misbehavior of the documented example
- to prove the proper behaviour when supplying `minion_id`
- to ensure some misbehaviour observed with compound matchers doesn't occur
* Fix for issue #59773
- When instantiating the loader grab values of grains and pillars if
they are NamedLoaderContext instances.
- The loader uses a copy of opts.
- Impliment deepcopy on NamedLoaderContext instances.
* Add changelog for #59773
* _get_initial_pillar function returns pillar
* Fix linter issues
* Clean up test
* Bump deprecation release for neutron
* Uncomment Sulfur release name
* Removing the _ext_nodes deprecation warning and alias.
* Adding changelog.
* Renaming changelog file.
* Update 59804.removed
* Initial pass at fips_mode config option
* Fix pre-commit
* Fix tests and add changelog
* update docs 3003
* update docs 3003 - newline
* Fix warts in changelog
* update releasenotes 3003
* add ubuntu-2004-amd64 m2crypto pycryptodome and tcp tests
* add distro_arch
* changing the cloud platforms file missed in 1a9b7be0e2f300d87924731dc5816fd1000cd22b
* Update __utils__ calls to import utils in azure
* Add changelog for 59744
* Fix azure unit tests and move to pytest
* Use contextvars from site-packages for thin
If a contextvars package exists one of the site-packages locations use
it for the generated thin tarball. This overrides python's builtin
contextvars and allows salt-ssh to work with python <=3.6 even when the
master's python is >3.6 (Fixes #59942)
* Add regression test for #59942
* Add changelog for #59942
* Update filemap to include test_py_versions
* Fix broken thin tests
* Always install the `contextvars` backport, even on Py3.7+
Without this change, salt-ssh cannot target systems with Python <= 3.6
* Use salt-factories to handle the container. Don't override default roster
* Fix thin tests on windows
* No need to use warn log level here
* Fix getsitepackages for old virtualenv versions
* Add explicit pyobjc reqs
* Add back the passthrough stuff
* Remove a line so pre-commit will run
* Bugfix release docs
* Bugfix release docs
* Removing pip-compile log files
* Bump requirements to address a few security issues
* Address traceback on macOS
```
Traceback (most recent call last):
File "setup.py", line 1448, in <module>
setup(distclass=SaltDistribution)
File "/Users/jenkins/setup-tests/.venv/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/opt/salt/lib/python3.7/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "setup.py", line 1068, in __init__
self.update_metadata()
File "setup.py", line 1074, in update_metadata
attrvalue = getattr(self, attrname, None)
File "setup.py", line 1182, in _property_install_requires
install_requires += _parse_requirements_file(reqfile)
File "setup.py", line 270, in _parse_requirements_file
platform.python_version(), _parse_op(op), _parse_ver(ver)
File "setup.py", line 247, in _check_ver
return getattr(operator, "__{}__".format(op))(pyver, wanted)
File "/opt/salt/lib/python3.7/distutils/version.py", line 46, in __eq__
c = self._cmp(other)
File "/opt/salt/lib/python3.7/distutils/version.py", line 337, in _cmp
if self.version < other.version:
TypeError: '<' not supported between instances of 'str' and 'int'
```
* Replace `saltstack.com` with `saltproject.io` on URLs being tested
* Add back support to load old entrypoints by iterating instead of type checking
Fixes #59961
* Fix issue #59975
* Fix pillar serialization for jinja #60083
* Fix test
* Add changelog for #60083
* Update changelog and release for 3003.1
* Remove the changelog source refs
* Add connect to IPCMessageSubscriber's async_methods
Fixes #60049 by making sure an IPCMessageSubscriber that is wrapped by
SyncWrapper has a connect method that runs the coroutine rather than
returns a fugure.
* Add changelog for #60049
* Update 60049.fixed
* Fix coroutine spelling error
Co-authored-by: Wayne Werner <waynejwerner@gmail.com>
* IPC on windows cannot use socket paths
Fixes #60298
* Update Jinja2 and lxml due to security related bugfix releases
Jinja2
------
CVE-2020-28493
moderate severity
Vulnerable versions: < 2.11.3
Patched version: 2.11.3
This affects the package jinja2 from 0.0.0 and before 2.11.3. The ReDOS vulnerability of the regex is mainly due to the sub-pattern [a-zA-Z0-9.-]+.[a-zA-Z0-9.-]+ This issue can be mitigated by Markdown to format user content instead of the urlize filter, or by implementing request timeouts and limiting process memory.
lxml
----
CVE-2021-28957
moderate severity
Vulnerable versions: < 4.6.3
Patched version: 4.6.3
An XSS vulnerability was discovered in the python lxml clean module versions before 4.6.3. When disabling the safe_attrs_only and forms arguments, the Cleaner class does not remove the formaction attribute allowing for JS to bypass the sanitizer. A remote attacker could exploit this flaw to run arbitrary JS code on users who interact with incorrectly sanitized HTML. This issue is patched in lxml 4.6.3.
* fix github actions jobs on branch until bullseye comes out
* Upgrade to `six==1.16.0` to avoid problems on CI runs
```
13:59:02 nox > Session invoke-pre-commit was successful.
13:59:02 nox > Running session invoke-pre-commit
13:59:02 nox > pip install --progress-bar=off -r requirements/static/ci/py3.7/invoke.txt
13:59:02 Collecting blessings==1.7
13:59:02 Using cached blessings-1.7-py3-none-any.whl (18 kB)
13:59:02 Collecting invoke==1.4.1
13:59:02 Using cached invoke-1.4.1-py3-none-any.whl (210 kB)
13:59:02 Collecting pyyaml==5.3.1
13:59:02 Using cached PyYAML-5.3.1.tar.gz (269 kB)
13:59:02 Collecting six==1.15.0
13:59:02 Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
13:59:02 Building wheels for collected packages: pyyaml
13:59:02 Building wheel for pyyaml (setup.py) ... - \ | / - \ | done
13:59:02 Created wheel for pyyaml: filename=PyYAML-5.3.1-cp37-cp37m-linux_x86_64.whl size=546391 sha256=e42e1d66cc32087f4d33ceb81268c86b59f1a97029b19459f91b8d6ad1430167
13:59:02 Stored in directory: /var/jenkins/.cache/pip/wheels/5e/03/1e/e1e954795d6f35dfc7b637fe2277bff021303bd9570ecea653
13:59:02 Successfully built pyyaml
13:59:02 Installing collected packages: six, pyyaml, invoke, blessings
13:59:02 Attempting uninstall: six
13:59:02 Found existing installation: six 1.16.0
13:59:02 Uninstalling six-1.16.0:
13:59:02 ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/var/jenkins/.cache/pre-commit/repomw8oee1s/py_env-python3/lib/python3.7/site-packages/__pycache__/six.cpython-37.pyc'
13:59:02
13:59:02 nox > Command pip install --progress-bar=off -r requirements/static/ci/py3.7/invoke.txt failed with exit code 1
13:59:02 nox > Session invoke-pre-commit failed.
```
* add changelog for https://github.com/saltstack/salt/issues/59982
* Regression test for #56273
* Fix race condition in batch. #56273
* Add changelog for #56273
* Update salt/client/__init__.py
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
* Update doc for salt/client
* Update changelog/56273.fixed
Thoreau said, "Simplify, Simplify"
* Update docs
* Update docs
* Update CHANGELOG.md
* Update 3003.1.rst
* Ignore configuration for 'enable_fqdns_grains' for AIX, Solaris and Juniper
* Added changelog
* Let Mac OS Mojave run for 8 hours to avoid timeout
* Remove FreeBSD-12.2
* Use Popen for VT
* Still allow shell True
* Drop shlex split
* Add crypto re-init
* Fix pre-commit
* Do not call close in isalive
* Skip tests not valid on windows
* Cleanup things that are not really needed
* We do not support irix
* Fix pre-commit
* Remove commented out lines
* Add changelog for #60504
* Fix pre-commit issues
* pyupgrade does not remove six imports
* Fix OSErrors in some test cases
* Remove un-needed args processing
* Make state_running test more reliable
* Removing tmpfs from Fedora 33.
* Address leaks in fileserver caused by git backends
At this time we do not have the ability to fix the upstream memory leaks
in the gitfs backend providers. Work around their limitations by
periodically restarting the file server update proccess. This will at
least partially address #50313
* Remove un-used import
* Fix warts caused by black version
* Add changelog
* We don't need two changelogs
* Also pin the ``pip`` upgrade to be ``<21.2``
* Update the external ipaddress to the latest 3.9.5 version which has some security fixes. Updating the compat.p to use the vendored version if the python version is below 3.9.5 and only run the test_ipaddress.py tests if below 3.9.5.
* Adding changelog
* Requested changes.
* Add shh_timeout to ssh_kwargs
* move to with blocks
* one with block
* reight crypto
* add back test file
* add changelog
* change log file number
* add m2crypt support
* only check m2crpto
* Delete 60571.fixed
* add back log
* add newline
* add newline for log file
* Work around https://github.com/pypa/pip/pull/9450
See https://github.com/pypa/pip/issues/10212
* Drop six and Py2
* [3003.2] Add server alive (#60573)
* add server alive
* rename log
* change default alive time
* add requested changes
* format string
* reformat string again
* run pre
* customize
* space
* remove EOF dead space
* fix pre-commit
* run pre
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
* Changelog for 3003.2
* Man pages update for 3003.2
* Allow CVE entries in `changelog/`
* Add security type for towncrier changelog
* Add security type for changelog entries pre-commit check
* Pin to ``pip>=20.2.4,<21.2``
Refs https://github.com/pypa/pip/pull/9450
* Drop six and Py2
* Fix bug introduced in https://github.com/saltstack/salt/pull/59648
Fixes #60046
* Add changelog
* Fix doc builds
* fix release notes about dropping ubuntu 16.04
* update file client
* add changelog file
* update changelog
* Check permissions of minion config directory
* Fix some wording in the messagebox and in comments
* Add changelog
* Fix extension for changelog
* Add missing commas. It also worked, but now is better
* docs_3003.3
* fixing version numbers in man pages.
* removing newlines.
* removing newlines.
* Fixing release notes.
* Fix changelog file for 3003.2 release
* Fix test_state test using loader.context
* Re-add test_context test
* Allow Local System account, add timestamp
* swaping the git-source for vsphere-automation-sdk-python
* Remove destroy, handled in context manager
Co-authored-by: Daniel Wozniak <dwozniak@saltstack.com>
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@wiked.org>
Co-authored-by: Hoa-Long Tam <hoalong@apple.com>
Co-authored-by: krionbsd <krion@freebsd.org>
Co-authored-by: Elias Probst <e.probst@ssc-services.de>
Co-authored-by: Daniel A. Wozniak <dwozniak@vmware.com>
Co-authored-by: Frode Gundersen <frogunder@gmail.com>
Co-authored-by: twangboy <slee@saltstack.com>
Co-authored-by: twangboy <leesh@vmware.com>
Co-authored-by: ScriptAutomate <derek@icanteven.io>
Co-authored-by: Wayne Werner <waynejwerner@gmail.com>
Co-authored-by: David Murphy < dmurphy@saltstack.com>
Co-authored-by: Joe Eacott <jeacott@vmware.com>
Co-authored-by: cmcmarrow <charles.mcmarrow.4@gmail.com>
Co-authored-by: Twangboy <shane.d.lee@gmail.com>
2021-09-22 20:42:38 -04:00
|
|
|
if _install_requirements(session, transport):
|
|
|
|
|
|
|
|
if crypto:
|
|
|
|
session.run(
|
|
|
|
"pip",
|
|
|
|
"uninstall",
|
|
|
|
"-y",
|
|
|
|
"m2crypto",
|
|
|
|
"pycrypto",
|
|
|
|
"pycryptodome",
|
|
|
|
"pycryptodomex",
|
|
|
|
silent=True,
|
|
|
|
)
|
|
|
|
install_command = [
|
|
|
|
"--progress-bar=off",
|
|
|
|
"--constraint",
|
|
|
|
_get_pip_requirements_file(session, transport, crypto=True),
|
|
|
|
]
|
|
|
|
install_command.append(crypto)
|
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
2019-03-25 17:49:33 +00:00
|
|
|
|
2019-02-20 16:40:10 +00:00
|
|
|
cmd_args = [
|
|
|
|
"--rootdir",
|
|
|
|
REPO_ROOT,
|
2019-06-08 18:19:01 +01:00
|
|
|
"--log-file={}".format(RUNTESTS_LOGFILE),
|
|
|
|
"--log-file-level=debug",
|
2020-05-22 16:18:55 +01:00
|
|
|
"--show-capture=no",
|
2019-02-20 16:40:10 +00:00
|
|
|
"-ra",
|
2019-03-25 14:51:45 +00:00
|
|
|
"-s",
|
|
|
|
"--transport={}".format(transport),
|
2019-02-20 16:40:10 +00:00
|
|
|
] + session.posargs
|
2019-04-14 16:00:34 +01:00
|
|
|
_pytest(session, coverage, cmd_args)
|
2019-03-25 15:07:39 +00:00
|
|
|
|
|
|
|
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS)
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def pytest(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
pytest session with zeromq transport and default crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
session.notify(
|
2020-06-08 09:14:07 +01:00
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"pytest-parametrized-{}".format(session.python),
|
|
|
|
coverage=coverage,
|
|
|
|
crypto=None,
|
|
|
|
transport="zeromq",
|
2019-03-25 17:49:33 +00:00
|
|
|
)
|
|
|
|
)
|
2019-03-25 15:07:39 +00:00
|
|
|
|
|
|
|
|
2019-04-05 15:57:30 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-tcp")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def pytest_tcp(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-05 15:57:30 +01:00
|
|
|
pytest session with TCP transport and default crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-05 15:57:30 +01:00
|
|
|
session.notify(
|
2020-06-08 09:14:07 +01:00
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"pytest-parametrized-{}".format(session.python),
|
|
|
|
coverage=coverage,
|
|
|
|
crypto=None,
|
|
|
|
transport="tcp",
|
2019-04-05 15:57:30 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-zeromq")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def pytest_zeromq(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
pytest session with zeromq transport and default crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
session.notify(
|
2020-06-08 09:14:07 +01:00
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"pytest-parametrized-{}".format(session.python),
|
|
|
|
coverage=coverage,
|
|
|
|
crypto=None,
|
|
|
|
transport="zeromq",
|
2019-03-25 17:49:33 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-03-25 15:07:39 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-m2crypto")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
2019-03-25 17:49:33 +00:00
|
|
|
def pytest_m2crypto(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
pytest session with zeromq transport and m2crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
session.notify(
|
2020-06-08 09:14:07 +01:00
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"pytest-parametrized-{}".format(session.python),
|
|
|
|
coverage=coverage,
|
|
|
|
crypto="m2crypto",
|
|
|
|
transport="zeromq",
|
2019-03-25 17:49:33 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-04-05 15:57:30 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-tcp-m2crypto")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def pytest_tcp_m2crypto(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-05 15:57:30 +01:00
|
|
|
pytest session with TCP transport and m2crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-05 15:57:30 +01:00
|
|
|
session.notify(
|
2020-06-08 09:14:07 +01:00
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"pytest-parametrized-{}".format(session.python),
|
|
|
|
coverage=coverage,
|
|
|
|
crypto="m2crypto",
|
|
|
|
transport="tcp",
|
2019-04-05 15:57:30 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-zeromq-m2crypto")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def pytest_zeromq_m2crypto(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
pytest session with zeromq transport and m2crypto
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
session.notify(
|
2020-06-08 09:14:07 +01:00
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"pytest-parametrized-{}".format(session.python),
|
|
|
|
coverage=coverage,
|
|
|
|
crypto="m2crypto",
|
|
|
|
transport="zeromq",
|
2019-03-25 17:49:33 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-04-23 09:32:34 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-pycryptodome")
|
2019-03-25 15:07:39 +00:00
|
|
|
@nox.parametrize("coverage", [False, True])
|
2020-04-23 09:32:34 +01:00
|
|
|
def pytest_pycryptodome(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-04-23 09:32:34 +01:00
|
|
|
pytest session with zeromq transport and pycryptodome
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
session.notify(
|
2020-06-08 09:14:07 +01:00
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"pytest-parametrized-{}".format(session.python),
|
|
|
|
coverage=coverage,
|
|
|
|
crypto="pycryptodome",
|
|
|
|
transport="zeromq",
|
2019-03-25 17:49:33 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-04-23 09:32:34 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-tcp-pycryptodome")
|
2019-04-05 15:57:30 +01:00
|
|
|
@nox.parametrize("coverage", [False, True])
|
2020-04-23 09:32:34 +01:00
|
|
|
def pytest_tcp_pycryptodome(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-04-23 09:32:34 +01:00
|
|
|
pytest session with TCP transport and pycryptodome
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-05 15:57:30 +01:00
|
|
|
session.notify(
|
2020-06-08 09:14:07 +01:00
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"pytest-parametrized-{}".format(session.python),
|
|
|
|
coverage=coverage,
|
|
|
|
crypto="pycryptodome",
|
|
|
|
transport="tcp",
|
2019-04-05 15:57:30 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-04-23 09:32:34 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-zeromq-pycryptodome")
|
2019-03-25 17:49:33 +00:00
|
|
|
@nox.parametrize("coverage", [False, True])
|
2020-04-23 09:32:34 +01:00
|
|
|
def pytest_zeromq_pycryptodome(session, coverage):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-04-23 09:32:34 +01:00
|
|
|
pytest session with zeromq transport and pycryptodome
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-03-25 17:49:33 +00:00
|
|
|
session.notify(
|
2020-06-08 09:14:07 +01:00
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"pytest-parametrized-{}".format(session.python),
|
|
|
|
coverage=coverage,
|
|
|
|
crypto="pycryptodome",
|
|
|
|
transport="zeromq",
|
2019-03-25 17:49:33 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-04-18 18:48:42 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-cloud")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def pytest_cloud(session, coverage):
|
2020-06-08 09:14:07 +01:00
|
|
|
"""
|
|
|
|
pytest cloud tests session
|
|
|
|
"""
|
2021-09-23 14:42:44 +01:00
|
|
|
pydir = _get_pydir(session)
|
|
|
|
if pydir == "py3.5":
|
|
|
|
session.error(
|
|
|
|
"Due to conflicting and unsupported requirements the cloud tests only run on Py3.6+"
|
|
|
|
)
|
2019-04-18 18:48:42 +01:00
|
|
|
# Install requirements
|
2021-08-03 14:03:17 +01:00
|
|
|
if _upgrade_pip_setuptools_and_wheel(session):
|
|
|
|
requirements_file = os.path.join(
|
2021-09-23 14:42:44 +01:00
|
|
|
"requirements", "static", "ci", pydir, "cloud.txt"
|
2021-08-03 14:03:17 +01:00
|
|
|
)
|
2019-04-18 18:48:42 +01:00
|
|
|
|
2021-08-03 14:03:17 +01:00
|
|
|
install_command = ["--progress-bar=off", "-r", requirements_file]
|
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
2020-04-27 09:09:05 +01:00
|
|
|
|
2019-04-18 18:48:42 +01:00
|
|
|
cmd_args = [
|
|
|
|
"--rootdir",
|
|
|
|
REPO_ROOT,
|
2019-06-08 18:19:01 +01:00
|
|
|
"--log-file={}".format(RUNTESTS_LOGFILE),
|
|
|
|
"--log-file-level=debug",
|
2020-05-22 16:18:55 +01:00
|
|
|
"--show-capture=no",
|
2019-04-18 18:48:42 +01:00
|
|
|
"-ra",
|
|
|
|
"-s",
|
2020-04-09 11:32:38 +01:00
|
|
|
"--run-expensive",
|
|
|
|
"-k",
|
|
|
|
"cloud",
|
2019-04-18 18:48:42 +01:00
|
|
|
] + session.posargs
|
|
|
|
_pytest(session, coverage, cmd_args)
|
|
|
|
|
|
|
|
|
2019-04-18 18:52:27 +01:00
|
|
|
@nox.session(python=_PYTHON_VERSIONS, name="pytest-tornado")
|
|
|
|
@nox.parametrize("coverage", [False, True])
|
|
|
|
def pytest_tornado(session, coverage):
|
2020-06-08 09:14:07 +01:00
|
|
|
"""
|
|
|
|
pytest tornado tests session
|
|
|
|
"""
|
2019-04-18 18:52:27 +01:00
|
|
|
# Install requirements
|
2021-08-03 14:03:17 +01:00
|
|
|
if _upgrade_pip_setuptools_and_wheel(session):
|
|
|
|
_install_requirements(session, "zeromq")
|
|
|
|
session.install(
|
|
|
|
"--progress-bar=off", "tornado==5.0.2", silent=PIP_INSTALL_SILENT
|
|
|
|
)
|
|
|
|
session.install(
|
|
|
|
"--progress-bar=off", "pyzmq==17.0.0", silent=PIP_INSTALL_SILENT
|
|
|
|
)
|
2019-04-18 18:52:27 +01:00
|
|
|
|
|
|
|
cmd_args = [
|
|
|
|
"--rootdir",
|
|
|
|
REPO_ROOT,
|
2019-06-08 18:19:01 +01:00
|
|
|
"--log-file={}".format(RUNTESTS_LOGFILE),
|
|
|
|
"--log-file-level=debug",
|
2020-05-22 16:18:55 +01:00
|
|
|
"--show-capture=no",
|
2019-04-18 18:52:27 +01:00
|
|
|
"-ra",
|
|
|
|
"-s",
|
|
|
|
] + session.posargs
|
|
|
|
_pytest(session, coverage, cmd_args)
|
|
|
|
|
|
|
|
|
2019-04-14 16:00:34 +01:00
|
|
|
def _pytest(session, coverage, cmd_args):
|
2019-03-25 15:07:39 +00:00
|
|
|
# Create required artifacts directories
|
|
|
|
_create_ci_directories()
|
2019-02-20 16:40:10 +00:00
|
|
|
|
2021-01-29 09:38:11 +00:00
|
|
|
env = {"CI_RUN": "1" if CI_RUN else "0"}
|
2019-11-12 17:25:30 +00:00
|
|
|
if IS_DARWIN:
|
|
|
|
# Don't nuke our multiprocessing efforts objc!
|
|
|
|
# https://stackoverflow.com/questions/50168647/multiprocessing-causes-python-to-crash-and-gives-an-error-may-have-been-in-progr
|
2020-09-14 18:29:48 +01:00
|
|
|
env["OBJC_DISABLE_INITIALIZE_FORK_SAFETY"] = "YES"
|
2019-11-12 17:25:30 +00:00
|
|
|
|
2020-04-17 21:37:42 +01:00
|
|
|
if CI_RUN:
|
|
|
|
# We'll print out the collected tests on CI runs.
|
|
|
|
# This will show a full list of what tests are going to run, in the right order, which, in case
|
|
|
|
# of a test suite hang, helps us pinpoint which test is hanging
|
|
|
|
session.run(
|
|
|
|
"python", "-m", "pytest", *(cmd_args + ["--collect-only", "-qqq"]), env=env
|
|
|
|
)
|
|
|
|
|
2019-03-22 17:27:01 +00:00
|
|
|
try:
|
|
|
|
if coverage is True:
|
2020-04-10 13:20:52 +01:00
|
|
|
_run_with_coverage(
|
2020-09-03 09:58:54 +01:00
|
|
|
session,
|
|
|
|
"python",
|
|
|
|
"-m",
|
|
|
|
"coverage",
|
|
|
|
"run",
|
|
|
|
"-m",
|
|
|
|
"pytest",
|
|
|
|
"--showlocals",
|
2020-09-14 18:29:48 +01:00
|
|
|
*cmd_args,
|
|
|
|
env=env
|
2020-04-10 13:20:52 +01:00
|
|
|
)
|
2019-03-22 17:27:01 +00:00
|
|
|
else:
|
2020-04-10 13:20:52 +01:00
|
|
|
session.run("python", "-m", "pytest", *cmd_args, env=env)
|
2019-12-03 14:10:08 +00:00
|
|
|
except CommandFailed: # pylint: disable=try-except-raise
|
2019-06-08 18:20:06 +01:00
|
|
|
# Not rerunning failed tests for now
|
|
|
|
raise
|
|
|
|
|
|
|
|
# pylint: disable=unreachable
|
2019-03-22 17:27:01 +00:00
|
|
|
# Re-run failed tests
|
|
|
|
session.log("Re-running failed tests")
|
2019-06-07 07:11:17 +01:00
|
|
|
|
|
|
|
for idx, parg in enumerate(cmd_args):
|
|
|
|
if parg.startswith("--junitxml="):
|
|
|
|
cmd_args[idx] = parg.replace(".xml", "-rerun-failed.xml")
|
2019-03-22 17:27:01 +00:00
|
|
|
cmd_args.append("--lf")
|
|
|
|
if coverage is True:
|
2020-04-10 13:20:52 +01:00
|
|
|
_run_with_coverage(
|
2020-08-14 15:19:49 +01:00
|
|
|
session,
|
|
|
|
"python",
|
|
|
|
"-m",
|
|
|
|
"coverage",
|
|
|
|
"run",
|
|
|
|
"-m",
|
|
|
|
"pytest",
|
|
|
|
"--showlocals",
|
|
|
|
*cmd_args
|
2020-04-10 13:20:52 +01:00
|
|
|
)
|
2019-03-22 17:27:01 +00:00
|
|
|
else:
|
2020-04-10 13:20:52 +01:00
|
|
|
session.run("python", "-m", "pytest", *cmd_args, env=env)
|
2019-06-08 18:20:06 +01:00
|
|
|
# pylint: enable=unreachable
|
2019-04-01 19:41:26 +01:00
|
|
|
|
|
|
|
|
2019-12-03 12:24:05 +00:00
|
|
|
class Tee:
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-12-03 12:24:05 +00:00
|
|
|
Python class to mimic linux tee behaviour
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
|
|
|
|
2019-12-03 12:24:05 +00:00
|
|
|
def __init__(self, first, second):
|
|
|
|
self._first = first
|
|
|
|
self._second = second
|
|
|
|
|
|
|
|
def write(self, b):
|
|
|
|
wrote = self._first.write(b)
|
|
|
|
self._first.flush()
|
|
|
|
self._second.write(b)
|
|
|
|
self._second.flush()
|
|
|
|
|
|
|
|
def fileno(self):
|
|
|
|
return self._first.fileno()
|
|
|
|
|
|
|
|
|
2021-09-22 12:57:30 +01:00
|
|
|
def _lint(
|
|
|
|
session, rcfile, flags, paths, tee_output=True, upgrade_setuptools_and_pip=True
|
|
|
|
):
|
|
|
|
if _upgrade_pip_setuptools_and_wheel(session, upgrade=upgrade_setuptools_and_pip):
|
2021-08-03 14:03:17 +01:00
|
|
|
requirements_file = os.path.join(
|
|
|
|
"requirements", "static", "ci", _get_pydir(session), "lint.txt"
|
|
|
|
)
|
|
|
|
install_command = ["--progress-bar=off", "-r", requirements_file]
|
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
2020-01-03 13:30:03 +00:00
|
|
|
|
|
|
|
if tee_output:
|
|
|
|
session.run("pylint", "--version")
|
|
|
|
pylint_report_path = os.environ.get("PYLINT_REPORT")
|
2019-04-01 19:41:26 +01:00
|
|
|
|
|
|
|
cmd_args = ["pylint", "--rcfile={}".format(rcfile)] + list(flags) + list(paths)
|
|
|
|
|
2020-01-03 13:30:03 +00:00
|
|
|
cmd_kwargs = {"env": {"PYTHONUNBUFFERED": "1"}}
|
|
|
|
|
|
|
|
if tee_output:
|
|
|
|
stdout = tempfile.TemporaryFile(mode="w+b")
|
|
|
|
cmd_kwargs["stdout"] = Tee(stdout, sys.__stdout__)
|
|
|
|
|
2019-04-13 16:24:41 +01:00
|
|
|
lint_failed = False
|
2019-04-01 19:41:26 +01:00
|
|
|
try:
|
2020-01-03 13:30:03 +00:00
|
|
|
session.run(*cmd_args, **cmd_kwargs)
|
2019-04-01 19:41:26 +01:00
|
|
|
except CommandFailed:
|
2019-04-13 16:24:41 +01:00
|
|
|
lint_failed = True
|
2019-04-01 19:41:26 +01:00
|
|
|
raise
|
2019-04-13 16:24:41 +01:00
|
|
|
finally:
|
2020-01-03 13:30:03 +00:00
|
|
|
if tee_output:
|
|
|
|
stdout.seek(0)
|
|
|
|
contents = stdout.read()
|
|
|
|
if contents:
|
|
|
|
if IS_PY3:
|
|
|
|
contents = contents.decode("utf-8")
|
|
|
|
else:
|
|
|
|
contents = contents.encode("utf-8")
|
|
|
|
sys.stdout.write(contents)
|
|
|
|
sys.stdout.flush()
|
|
|
|
if pylint_report_path:
|
|
|
|
# Write report
|
|
|
|
with open(pylint_report_path, "w") as wfh:
|
|
|
|
wfh.write(contents)
|
|
|
|
session.log("Report file written to %r", pylint_report_path)
|
|
|
|
stdout.close()
|
|
|
|
|
|
|
|
|
|
|
|
def _lint_pre_commit(session, rcfile, flags, paths):
|
|
|
|
if "VIRTUAL_ENV" not in os.environ:
|
|
|
|
session.error(
|
|
|
|
"This should be running from within a virtualenv and "
|
|
|
|
"'VIRTUAL_ENV' was not found as an environment variable."
|
|
|
|
)
|
|
|
|
if "pre-commit" not in os.environ["VIRTUAL_ENV"]:
|
|
|
|
session.error(
|
|
|
|
"This should be running from within a pre-commit virtualenv and "
|
|
|
|
"'VIRTUAL_ENV'({}) does not appear to be a pre-commit virtualenv.".format(
|
|
|
|
os.environ["VIRTUAL_ENV"]
|
|
|
|
)
|
|
|
|
)
|
|
|
|
from nox.virtualenv import VirtualEnv
|
2020-04-02 20:10:20 -05:00
|
|
|
|
2020-01-03 13:30:03 +00:00
|
|
|
# Let's patch nox to make it run inside the pre-commit virtualenv
|
|
|
|
try:
|
|
|
|
session._runner.venv = VirtualEnv( # pylint: disable=unexpected-keyword-arg
|
|
|
|
os.environ["VIRTUAL_ENV"],
|
|
|
|
interpreter=session._runner.func.python,
|
|
|
|
reuse_existing=True,
|
|
|
|
venv=True,
|
|
|
|
)
|
|
|
|
except TypeError:
|
|
|
|
# This is still nox-py2
|
|
|
|
session._runner.venv = VirtualEnv(
|
|
|
|
os.environ["VIRTUAL_ENV"],
|
|
|
|
interpreter=session._runner.func.python,
|
|
|
|
reuse_existing=True,
|
|
|
|
)
|
2021-09-22 12:57:30 +01:00
|
|
|
_lint(
|
|
|
|
session,
|
|
|
|
rcfile,
|
|
|
|
flags,
|
|
|
|
paths,
|
|
|
|
tee_output=False,
|
|
|
|
upgrade_setuptools_and_pip=False,
|
|
|
|
)
|
2019-04-01 19:41:26 +01:00
|
|
|
|
|
|
|
|
2019-12-03 10:57:49 +00:00
|
|
|
@nox.session(python="3")
|
2019-04-01 19:41:26 +01:00
|
|
|
def lint(session):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-01 19:41:26 +01:00
|
|
|
Run PyLint against Salt and it's test suite. Set PYLINT_REPORT to a path to capture output.
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-01 19:41:26 +01:00
|
|
|
session.notify("lint-salt-{}".format(session.python))
|
|
|
|
session.notify("lint-tests-{}".format(session.python))
|
|
|
|
|
|
|
|
|
2019-12-03 10:57:49 +00:00
|
|
|
@nox.session(python="3", name="lint-salt")
|
2019-04-01 19:41:26 +01:00
|
|
|
def lint_salt(session):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-01 19:41:26 +01:00
|
|
|
Run PyLint against Salt. Set PYLINT_REPORT to a path to capture output.
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-12-03 11:51:53 +00:00
|
|
|
flags = ["--disable=I"]
|
2019-04-01 19:41:26 +01:00
|
|
|
if session.posargs:
|
|
|
|
paths = session.posargs
|
|
|
|
else:
|
2020-04-23 11:48:17 +01:00
|
|
|
paths = ["setup.py", "noxfile.py", "salt/", "tasks/"]
|
2019-12-03 10:57:49 +00:00
|
|
|
_lint(session, ".pylintrc", flags, paths)
|
2019-04-01 19:41:26 +01:00
|
|
|
|
|
|
|
|
2019-12-03 10:57:49 +00:00
|
|
|
@nox.session(python="3", name="lint-tests")
|
2019-04-01 19:41:26 +01:00
|
|
|
def lint_tests(session):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-01 19:41:26 +01:00
|
|
|
Run PyLint against Salt and it's test suite. Set PYLINT_REPORT to a path to capture output.
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-12-03 11:51:53 +00:00
|
|
|
flags = ["--disable=I"]
|
2019-04-01 19:41:26 +01:00
|
|
|
if session.posargs:
|
|
|
|
paths = session.posargs
|
|
|
|
else:
|
|
|
|
paths = ["tests/"]
|
2019-12-03 10:57:49 +00:00
|
|
|
_lint(session, ".pylintrc", flags, paths)
|
2019-04-02 17:16:49 +01:00
|
|
|
|
|
|
|
|
2020-01-03 13:30:03 +00:00
|
|
|
@nox.session(python=False, name="lint-salt-pre-commit")
|
|
|
|
def lint_salt_pre_commit(session):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-01-03 13:30:03 +00:00
|
|
|
Run PyLint against Salt. Set PYLINT_REPORT to a path to capture output.
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-01-03 13:30:03 +00:00
|
|
|
flags = ["--disable=I"]
|
|
|
|
if session.posargs:
|
|
|
|
paths = session.posargs
|
|
|
|
else:
|
|
|
|
paths = ["setup.py", "noxfile.py", "salt/"]
|
|
|
|
_lint_pre_commit(session, ".pylintrc", flags, paths)
|
|
|
|
|
|
|
|
|
|
|
|
@nox.session(python=False, name="lint-tests-pre-commit")
|
|
|
|
def lint_tests_pre_commit(session):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-01-03 13:30:03 +00:00
|
|
|
Run PyLint against Salt and it's test suite. Set PYLINT_REPORT to a path to capture output.
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-01-03 13:30:03 +00:00
|
|
|
flags = ["--disable=I"]
|
|
|
|
if session.posargs:
|
|
|
|
paths = session.posargs
|
|
|
|
else:
|
|
|
|
paths = ["tests/"]
|
|
|
|
_lint_pre_commit(session, ".pylintrc", flags, paths)
|
|
|
|
|
|
|
|
|
2019-05-29 11:36:03 +01:00
|
|
|
@nox.session(python="3")
|
2020-08-07 16:16:08 -04:00
|
|
|
@nox.parametrize("clean", [False, True])
|
2019-10-28 14:17:49 +00:00
|
|
|
@nox.parametrize("update", [False, True])
|
|
|
|
@nox.parametrize("compress", [False, True])
|
2020-08-07 16:16:08 -04:00
|
|
|
def docs(session, compress, update, clean):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-04-02 17:16:49 +01:00
|
|
|
Build Salt's Documentation
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2020-06-08 09:14:07 +01:00
|
|
|
session.notify("docs-html-{}(compress={})".format(session.python, compress))
|
|
|
|
session.notify(
|
|
|
|
find_session_runner(
|
|
|
|
session,
|
|
|
|
"docs-man-{}".format(session.python),
|
|
|
|
compress=compress,
|
|
|
|
update=update,
|
2020-08-07 16:16:08 -04:00
|
|
|
clean=clean,
|
2020-06-08 09:14:07 +01:00
|
|
|
)
|
|
|
|
)
|
2019-10-28 14:17:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
@nox.session(name="docs-html", python="3")
|
2020-08-07 16:16:08 -04:00
|
|
|
@nox.parametrize("clean", [False, True])
|
2019-10-28 14:17:49 +00:00
|
|
|
@nox.parametrize("compress", [False, True])
|
2020-08-07 16:16:08 -04:00
|
|
|
def docs_html(session, compress, clean):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-10-28 14:17:49 +00:00
|
|
|
Build Salt's HTML Documentation
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2021-08-03 14:03:17 +01:00
|
|
|
if _upgrade_pip_setuptools_and_wheel(session):
|
|
|
|
requirements_file = os.path.join(
|
|
|
|
"requirements", "static", "ci", _get_pydir(session), "docs.txt"
|
|
|
|
)
|
|
|
|
install_command = ["--progress-bar=off", "-r", requirements_file]
|
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
2019-04-02 17:16:49 +01:00
|
|
|
os.chdir("doc/")
|
2020-08-07 16:16:08 -04:00
|
|
|
if clean:
|
|
|
|
session.run("make", "clean", external=True)
|
2019-05-29 11:28:55 +01:00
|
|
|
session.run("make", "html", "SPHINXOPTS=-W", external=True)
|
2019-10-28 14:17:49 +00:00
|
|
|
if compress:
|
2019-12-01 15:19:51 -07:00
|
|
|
session.run("tar", "-cJvf", "html-archive.tar.xz", "_build/html", external=True)
|
2019-10-28 14:17:49 +00:00
|
|
|
os.chdir("..")
|
|
|
|
|
|
|
|
|
|
|
|
@nox.session(name="docs-man", python="3")
|
2020-08-07 16:16:08 -04:00
|
|
|
@nox.parametrize("clean", [False, True])
|
2019-10-28 14:17:49 +00:00
|
|
|
@nox.parametrize("update", [False, True])
|
|
|
|
@nox.parametrize("compress", [False, True])
|
2020-08-07 16:16:08 -04:00
|
|
|
def docs_man(session, compress, update, clean):
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2019-10-28 14:17:49 +00:00
|
|
|
Build Salt's Manpages Documentation
|
2020-04-02 20:10:20 -05:00
|
|
|
"""
|
2021-08-03 14:03:17 +01:00
|
|
|
if _upgrade_pip_setuptools_and_wheel(session):
|
|
|
|
requirements_file = os.path.join(
|
|
|
|
"requirements", "static", "ci", _get_pydir(session), "docs.txt"
|
|
|
|
)
|
|
|
|
install_command = ["--progress-bar=off", "-r", requirements_file]
|
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
2019-10-28 14:17:49 +00:00
|
|
|
os.chdir("doc/")
|
2020-08-07 16:16:08 -04:00
|
|
|
if clean:
|
|
|
|
session.run("make", "clean", external=True)
|
2019-10-28 14:17:49 +00:00
|
|
|
session.run("make", "man", "SPHINXOPTS=-W", external=True)
|
|
|
|
if update:
|
|
|
|
session.run("rm", "-rf", "man/", external=True)
|
|
|
|
session.run("cp", "-Rp", "_build/man", "man/", external=True)
|
|
|
|
if compress:
|
2019-12-01 15:19:51 -07:00
|
|
|
session.run("tar", "-cJvf", "man-archive.tar.xz", "_build/man", external=True)
|
2019-04-02 17:16:49 +01:00
|
|
|
os.chdir("..")
|
2020-04-23 11:48:17 +01:00
|
|
|
|
|
|
|
|
2021-06-28 07:11:39 +01:00
|
|
|
@nox.session(name="invoke", python="3")
|
|
|
|
def invoke(session):
|
2020-04-23 11:48:17 +01:00
|
|
|
"""
|
|
|
|
Run invoke tasks
|
|
|
|
"""
|
2021-08-03 14:03:17 +01:00
|
|
|
if _upgrade_pip_setuptools_and_wheel(session):
|
2021-08-04 07:35:34 +01:00
|
|
|
_install_requirements(session, "zeromq")
|
2021-08-03 14:03:17 +01:00
|
|
|
requirements_file = os.path.join(
|
|
|
|
"requirements", "static", "ci", _get_pydir(session), "invoke.txt"
|
|
|
|
)
|
|
|
|
install_command = ["--progress-bar=off", "-r", requirements_file]
|
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
2021-08-04 07:35:34 +01:00
|
|
|
|
2020-04-23 11:48:17 +01:00
|
|
|
cmd = ["inv"]
|
|
|
|
files = []
|
|
|
|
|
|
|
|
# Unfortunately, invoke doesn't support the nargs functionality like argpase does.
|
|
|
|
# Let's make it behave properly
|
|
|
|
for idx, posarg in enumerate(session.posargs):
|
|
|
|
if idx == 0:
|
|
|
|
cmd.append(posarg)
|
|
|
|
continue
|
|
|
|
if posarg.startswith("--"):
|
|
|
|
cmd.append(posarg)
|
|
|
|
continue
|
|
|
|
files.append(posarg)
|
|
|
|
if files:
|
|
|
|
cmd.append("--files={}".format(" ".join(files)))
|
|
|
|
session.run(*cmd)
|
|
|
|
|
|
|
|
|
2020-04-14 18:37:33 -04:00
|
|
|
@nox.session(name="changelog", python="3")
|
|
|
|
@nox.parametrize("draft", [False, True])
|
|
|
|
def changelog(session, draft):
|
|
|
|
"""
|
|
|
|
Generate salt's changelog
|
|
|
|
"""
|
2021-08-03 14:03:17 +01:00
|
|
|
if _upgrade_pip_setuptools_and_wheel(session):
|
|
|
|
requirements_file = os.path.join(
|
|
|
|
"requirements", "static", "ci", _get_pydir(session), "changelog.txt"
|
|
|
|
)
|
|
|
|
install_command = ["--progress-bar=off", "-r", requirements_file]
|
|
|
|
session.install(*install_command, silent=PIP_INSTALL_SILENT)
|
2020-04-14 18:37:33 -04:00
|
|
|
|
2020-04-16 17:01:32 -04:00
|
|
|
town_cmd = ["towncrier", "--version={}".format(session.posargs[0])]
|
2020-04-14 18:37:33 -04:00
|
|
|
if draft:
|
|
|
|
town_cmd.append("--draft")
|
|
|
|
session.run(*town_cmd)
|