Fixed NoneType import error which worked in python2, but not 3.

In mod_args we were checking `isinstance(thing, NoneType)` when
thing is None works the same since NoneType can't be subclassed in
python 2 or 3 and it removes the need for the NoneType import.
This commit is contained in:
Rory Finnegan 2015-04-15 22:32:03 -04:00
parent 176ae06cbd
commit 43ab4c12dd

View file

@ -20,7 +20,6 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
from six import iteritems, string_types from six import iteritems, string_types
from types import NoneType
from ansible.errors import AnsibleParserError from ansible.errors import AnsibleParserError
from ansible.plugins import module_loader from ansible.plugins import module_loader
@ -165,7 +164,7 @@ class ModuleArgsParser:
# form is like: local_action: copy src=a dest=b ... pretty common # form is like: local_action: copy src=a dest=b ... pretty common
check_raw = action in ('command', 'shell', 'script') check_raw = action in ('command', 'shell', 'script')
args = parse_kv(thing, check_raw=check_raw) args = parse_kv(thing, check_raw=check_raw)
elif isinstance(thing, NoneType): elif thing is None:
# this can happen with modules which take no params, like ping: # this can happen with modules which take no params, like ping:
args = None args = None
else: else: