From 5dca638ca374e008630ad72f54fe4c8747fe3d6b Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: May 17 2019 18:46:53 +0000 Subject: Fixes for various releases build/test issues. --- diff --git a/56596.patch b/56596.patch new file mode 100644 index 0000000..7e10b96 --- /dev/null +++ b/56596.patch @@ -0,0 +1,32 @@ +From 949c35911e92b5bce1d21c7ed93425ccddd527fd Mon Sep 17 00:00:00 2001 +From: Matt Martz +Date: Fri, 17 May 2019 12:48:58 -0500 +Subject: [PATCH] Add compat tojson filter for jinja2 versions missing it + +--- + docs/bin/plugin_formatter.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/docs/bin/plugin_formatter.py b/docs/bin/plugin_formatter.py +index 1774aca70281..83a00639ee88 100755 +--- a/docs/bin/plugin_formatter.py ++++ b/docs/bin/plugin_formatter.py +@@ -11,6 +11,7 @@ + + import datetime + import glob ++import json + import optparse + import os + import re +@@ -399,6 +400,10 @@ def jinja2_environment(template_dir, typ, plugin_type): + # Jinja < 2.10 + env.filters['max'] = do_max + ++ if 'tojson' not in env.filters: ++ # Jinja < 2.9 ++ env.filters['tojson'] = json.dumps ++ + templates = {} + if typ == 'rst': + env.filters['rst_ify'] = rst_ify diff --git a/ansible.spec b/ansible.spec index 1fa83f4..c3cdcb2 100644 --- a/ansible.spec +++ b/ansible.spec @@ -30,11 +30,16 @@ Name: ansible Summary: SSH-based configuration management, deployment, and task execution system Version: 2.8.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Source0: https://releases.ansible.com/ansible/%{name}-%{version}.tar.gz +# This patch adds compat for the tojson filter in jinja2 +# Older versions do not have this filer. +# Upstream at https://github.com/ansible/ansible/pull/56596 +Patch1: https://patch-diff.githubusercontent.com/raw/ansible/ansible/pull/56596.patch + # Patch to utilize a newer jinja2 package on epel6 # Non-upstreamable as it creates a dependency on a specific version of jinja. # This is desirable for us as we have packages for that version but not for @@ -85,11 +90,14 @@ BuildRequires: python-mock BuildRequires: python-boto3 BuildRequires: python-botocore BuildRequires: python-passlib +%if 0%{?fedora} # Fedora only docs building BuildRequires: python3-sphinx-theme-alabaster +%endif # rhel7 does not have python-pytest but has pytest %if 0%{?rhel} == 7 BuildRequires: pytest +BuildRequires: python2-sphinx-theme-alabaster %else BuildRequires: python-pytest BuildRequires: python-pytest-xdist @@ -255,6 +263,8 @@ This package installs extensive documentation for ansible %prep %setup -q -n %{name}-%{version} +%patch1 -p1 + %if 0%{?rhel} == 6 %patch100 -p1 %endif @@ -393,12 +403,17 @@ pathfix.py -i %{__python3} -p test/runner pathfix.py -i %{__python3} -p bin/ansible-test # This test needs a module not packaged in Fedora so disable it. rm -f test/units/modules/cloud/cloudstack/test_cs_traffic_type.py +%if 0%{?fedora} < 30 +# In fedora 29 and eariler, python-gitlab is too old to run these tests +rm -f test/units/modules/source_control/test_gitlab_user.py +rm -f test/units/modules/source_control/test_gitlab_runner.py +%endif make PYTHON=/usr/bin/python3 tests-py3 + popd %endif # python3 - %files %if 0%{?with_python2} %{python2_sitelib}/ansible* @@ -430,6 +445,9 @@ popd %endif %changelog +* Fri May 17 2019 Kevin Fenzi - 2.8.0-2 +- Fixes for various releases build/test issues. + * Fri May 17 2019 Kevin Fenzi - 2.8.0-1 - Update to 2.8.0 final. - Add datadirs for other packages to land ansible files in.