Commit 95e655eb by Marius Gedminas

Python 3: there's no basestring

Fixes one failing test.

The long series of module_utils/basic.py fixes were all because
module_utils/basic is imported in ansible/inventory/script.py.
parent 2c4982b5
...@@ -26,6 +26,8 @@ import re ...@@ -26,6 +26,8 @@ import re
import stat import stat
import itertools import itertools
from six import string_types
from ansible import constants as C from ansible import constants as C
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
...@@ -78,7 +80,7 @@ class Inventory(object): ...@@ -78,7 +80,7 @@ class Inventory(object):
def parse_inventory(self, host_list): def parse_inventory(self, host_list):
if isinstance(host_list, basestring): if isinstance(host_list, string_types):
if "," in host_list: if "," in host_list:
host_list = host_list.split(",") host_list = host_list.split(",")
host_list = [ h for h in host_list if h and h.strip() ] host_list = [ h for h in host_list if h and h.strip() ]
...@@ -589,7 +591,7 @@ class Inventory(object): ...@@ -589,7 +591,7 @@ class Inventory(object):
def is_file(self): def is_file(self):
""" did inventory come from a file? """ """ did inventory come from a file? """
if not isinstance(self.host_list, basestring): if not isinstance(self.host_list, string_types):
return False return False
return self._loader.path_exists(self.host_list) return self._loader.path_exists(self.host_list)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment