summaryrefslogtreecommitdiff
path: root/lib/ansible/inventory
diff options
context:
space:
mode:
authorJames Cassell <code@james.cassell.me>2019-06-03 10:56:03 -0400
committerToshio Kuratomi <a.badger@gmail.com>2019-06-04 14:04:17 -0700
commit1fb0335243b4d0cdeda4462a8f0fdf01a8a89cf5 (patch)
treed346b5787d8aca37acecc223dd52c75e8089a581 /lib/ansible/inventory
parent47cfbd66054a8908fcf28a4bd829df635072a775 (diff)
downloadansible-1fb0335243b4d0cdeda4462a8f0fdf01a8a89cf5.tar.gz
group_chars: default change warning only when needed
Diffstat (limited to 'lib/ansible/inventory')
-rw-r--r--lib/ansible/inventory/group.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ansible/inventory/group.py b/lib/ansible/inventory/group.py
index 810d57a271..6d5e19ef59 100644
--- a/lib/ansible/inventory/group.py
+++ b/lib/ansible/inventory/group.py
@@ -48,8 +48,10 @@ def to_safe_group_name(name, replacer="_", force=False, silent=False):
warn = 'Invalid characters were found in group names but not replaced, use -vvvv to see details'
# remove this message after 2.10 AND changing the default to 'always'
- display.deprecated('The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default,'
- ' this will change, but still be user configurable on deprecation', version='2.10')
+ group_chars_setting, group_chars_origin = C.config.get_config_value_and_origin('TRANSFORM_INVALID_GROUP_CHARS')
+ if group_chars_origin == 'default':
+ display.deprecated('The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default,'
+ ' this will change, but still be user configurable on deprecation', version='2.10')
if warn:
display.warning(warn)