Coverage for lib/ansible/vars/reserved.py : 78%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# (c) 2017 Ansible By Red Hat # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
except ImportError: from ansible.utils.display import Display display = Display()
''' this function returns the list of reserved names associated with play objects'''
# FIXME: find a way to 'not hardcode', possibly need role deps/includes
# build ordered list to loop over and dict with attributes private.add(attribute) else:
# local_action is implicit with action
# loop implies with_ # FIXME: remove after with_ is not only deprecated but removed
else: result = public
''' this function warns if any variable passed conflicts with internally reserved names '''
display.warning('Found variable using reserved name: %s' % varname)
|