mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-21 04:10:23 -07:00
Add toggle to control invalid character substitution in group names (#52748)
* make add_group return proper name * ensure central transform/check * added 'silent' option to avoid spamming current users those already using the plugins were used to the transformations, so no need to alert them * centralized valid var names * dont display dupes * comment on regex * added regex tests ini and script will now warn about deprecation * more complete errormsg
This commit is contained in:
parent
9c54649449
commit
d241794daa
14 changed files with 107 additions and 41 deletions
|
@ -6,6 +6,7 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
from ast import literal_eval
|
||||
from jinja2 import Template
|
||||
|
@ -117,6 +118,9 @@ TREE_DIR = None
|
|||
VAULT_VERSION_MIN = 1.0
|
||||
VAULT_VERSION_MAX = 1.0
|
||||
|
||||
# This matches a string that cannot be used as a valid python variable name i.e 'not-valid', 'not!valid@either' '1_nor_This'
|
||||
INVALID_VARIABLE_NAMES = re.compile(r'^[^a-zA-Z_]|[^a-zA-Z0-9_]')
|
||||
|
||||
# FIXME: remove once play_context mangling is removed
|
||||
# the magic variable mapping dictionary below is used to translate
|
||||
# host/inventory variables to fields in the PlayContext
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue