From 43ab4c12dd378ec9e930172c6530c7cd6bccfb9b Mon Sep 17 00:00:00 2001 From: Rory Finnegan Date: Wed, 15 Apr 2015 22:32:03 -0400 Subject: [PATCH] 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. --- v2/ansible/parsing/mod_args.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/v2/ansible/parsing/mod_args.py b/v2/ansible/parsing/mod_args.py index 6650355ba3..e3fdba093d 100644 --- a/v2/ansible/parsing/mod_args.py +++ b/v2/ansible/parsing/mod_args.py @@ -20,7 +20,6 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from six import iteritems, string_types -from types import NoneType from ansible.errors import AnsibleParserError from ansible.plugins import module_loader @@ -165,7 +164,7 @@ class ModuleArgsParser: # form is like: local_action: copy src=a dest=b ... pretty common check_raw = action in ('command', 'shell', 'script') 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: args = None else: