mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Python 3: there's no basestring
This commit is contained in:
parent
3cae8a4394
commit
9ba6c087d3
1 changed files with 3 additions and 1 deletions
|
@ -24,6 +24,8 @@ import locale
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible.errors import *
|
from ansible.errors import *
|
||||||
from ansible.executor.task_queue_manager import TaskQueueManager
|
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,
|
# 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
|
# 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_pct = int(play.serial.replace("%",""))
|
||||||
serial = int((serial_pct/100.0) * len(all_hosts))
|
serial = int((serial_pct/100.0) * len(all_hosts))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue