Skip to content

Commit

Permalink
Merge pull request ansible#12725 from mgedmin/py3k
Browse files Browse the repository at this point in the history
Python 3: there's no basestring
  • Loading branch information
jimi-c committed Oct 13, 2015
2 parents 3f2efdd + 9ba6c08 commit ee559e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ansible/executor/playbook_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
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
Expand Down Expand Up @@ -223,7 +225,7 @@ def _get_serialized_batches(self, play):

# 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:
Expand Down

0 comments on commit ee559e0

Please sign in to comment.