mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
9178e176b5
commit
4f29662a9e
4 changed files with 24 additions and 25 deletions
|
@ -81,6 +81,7 @@ def preprocess_vars(a):
|
|||
|
||||
return data
|
||||
|
||||
|
||||
def strip_internal_keys(dirty):
|
||||
'''
|
||||
All keys stating with _ansible_ are internal, so create a copy of the 'dirty' dict
|
||||
|
@ -628,7 +629,6 @@ class VariableManager:
|
|||
|
||||
return data
|
||||
|
||||
|
||||
def add_group_vars_file(self, path, loader):
|
||||
'''
|
||||
Loads and caches a host_vars file in the _host_vars_files dict,
|
||||
|
|
|
@ -40,6 +40,7 @@ except ImportError:
|
|||
|
||||
__all__ = ['HostVars']
|
||||
|
||||
|
||||
# Note -- this is a Mapping, not a MutableMapping
|
||||
class HostVars(collections.Mapping):
|
||||
''' A special view of vars_cache that adds values from the inventory when needed. '''
|
||||
|
|
|
@ -30,6 +30,7 @@ except ImportError:
|
|||
from ansible.utils.display import Display
|
||||
display = Display()
|
||||
|
||||
|
||||
def get_reserved_names(include_private=True):
|
||||
''' this function returns the list of reserved names associated with play objects'''
|
||||
|
||||
|
@ -66,6 +67,7 @@ def get_reserved_names(include_private=True):
|
|||
|
||||
return result
|
||||
|
||||
|
||||
def warn_if_reserved(myvars):
|
||||
''' this function warns if any variable passed conflicts with internally reserved names '''
|
||||
reserved = get_reserved_names()
|
||||
|
@ -74,4 +76,3 @@ def warn_if_reserved(myvars):
|
|||
continue # we add this one internally
|
||||
if varname in reserved:
|
||||
display.warning('Found variable using reserved name: %s' % varname)
|
||||
|
||||
|
|
|
@ -873,9 +873,6 @@ lib/ansible/utils/listify.py
|
|||
lib/ansible/utils/path.py
|
||||
lib/ansible/utils/ssh_functions.py
|
||||
lib/ansible/utils/vars.py
|
||||
lib/ansible/vars/__init__.py
|
||||
lib/ansible/vars/hostvars.py
|
||||
lib/ansible/vars/reserved.py
|
||||
setup.py
|
||||
test/integration/cleanup_azure.py
|
||||
test/integration/cleanup_ec2.py
|
||||
|
|
Loading…
Reference in a new issue