mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Revert "Add a few Jinja2 tests to simplify template (#37514)"
This reverts commit b8e07f0d6e.
This commit is contained in:
@@ -29,7 +29,7 @@ import os
|
||||
import re
|
||||
import sys
|
||||
import warnings
|
||||
from collections import defaultdict, Sequence
|
||||
from collections import defaultdict
|
||||
from distutils.version import LooseVersion
|
||||
from pprint import PrettyPrinter
|
||||
|
||||
@@ -132,12 +132,6 @@ def rst_xline(width, char="="):
|
||||
return char * width
|
||||
|
||||
|
||||
# NOTE: The existing Jinja2 'sequence' tests matches strings and dictionaries
|
||||
def test_list(value):
|
||||
''' Return true if objects is a list or tupple '''
|
||||
return isinstance(value, Sequence)
|
||||
|
||||
|
||||
def write_data(text, output_dir, outputname, module=None):
|
||||
''' dumps module output to a file or the screen, as requested '''
|
||||
|
||||
@@ -310,9 +304,6 @@ def jinja2_environment(template_dir, typ, plugin_type):
|
||||
env.filters['html_ify'] = html_ify
|
||||
env.filters['fmt'] = rst_fmt
|
||||
env.filters['xline'] = rst_xline
|
||||
|
||||
env.tests['list'] = test_list
|
||||
|
||||
templates['plugin'] = env.get_template('plugin.rst.j2')
|
||||
|
||||
if plugin_type == 'module':
|
||||
|
||||
Reference in New Issue
Block a user