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