diff options
author | Dag Wieers <dag@wieers.com> | 2017-05-16 19:51:27 +0200 |
---|---|---|
committer | John R Barker <john@johnrbarker.com> | 2017-05-16 18:51:27 +0100 |
commit | 4f29662a9edf41187f779b7a1283b298a0c08ab7 (patch) | |
tree | 0efacf565d7945c5536d22a6b44f2241918052f4 /lib/ansible/vars/reserved.py | |
parent | 9178e176b554fe260fb25743aaeb4bb9079d34f5 (diff) | |
download | ansible-4f29662a9edf41187f779b7a1283b298a0c08ab7.tar.gz |
ansible/vars/: PEP8 compliancy (#24685)
- Make PEP8 compliant
Diffstat (limited to 'lib/ansible/vars/reserved.py')
-rw-r--r-- | lib/ansible/vars/reserved.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/ansible/vars/reserved.py b/lib/ansible/vars/reserved.py index e83d2e8712..99535c2a7b 100644 --- a/lib/ansible/vars/reserved.py +++ b/lib/ansible/vars/reserved.py @@ -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''' @@ -37,8 +38,8 @@ def get_reserved_names(include_private=True): private = set() result = set() - #FIXME: find a way to 'not hardcode', possibly need role deps/includes - class_list = [ Play, Role, Block, Task ] + # FIXME: find a way to 'not hardcode', possibly need role deps/includes + class_list = [Play, Role, Block, Task] for aclass in class_list: aobj = aclass() @@ -55,7 +56,7 @@ def get_reserved_names(include_private=True): public.add('local_action') # loop implies with_ - #FIXME: remove after with_ is not only deprecated but removed + # FIXME: remove after with_ is not only deprecated but removed if 'loop' in private or 'loop' in public: public.add('with_') @@ -66,12 +67,12 @@ 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() for varname in myvars: if varname == 'vars': - continue # we add this one internally + continue # we add this one internally if varname in reserved: display.warning('Found variable using reserved name: %s' % varname) - |