From 9ba6c087d3bb071534f59c9108dbe5e8e91f1303 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 13 Oct 2015 09:56:12 +0300 Subject: [PATCH] Python 3: there's no basestring --- lib/ansible/executor/playbook_executor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/executor/playbook_executor.py b/lib/ansible/executor/playbook_executor.py index 0b3d7f0db7..b53ccfc9d8 100644 --- a/lib/ansible/executor/playbook_executor.py +++ b/lib/ansible/executor/playbook_executor.py @@ -24,6 +24,8 @@ import locale import signal import sys +from six import string_types + from ansible import constants as C from ansible.errors import * from ansible.executor.task_queue_manager import TaskQueueManager @@ -223,7 +225,7 @@ class PlaybookExecutor: # check to see if the serial number was specified as a percentage, # and convert it to an integer value based on the number of hosts - if isinstance(play.serial, basestring) and play.serial.endswith('%'): + if isinstance(play.serial, string_types) and play.serial.endswith('%'): serial_pct = int(play.serial.replace("%","")) serial = int((serial_pct/100.0) * len(all_hosts)) else: