mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix TypeError: argument of type int is not iterable
This commit is contained in:
parent
ed908b3e51
commit
d4abddd3ed
1 changed files with 1 additions and 6 deletions
|
@ -8,7 +8,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
import math
|
||||
import time
|
||||
import copy
|
||||
import sys
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
# Import salt libs
|
||||
|
@ -86,11 +85,7 @@ class Batch(object):
|
|||
'''
|
||||
partition = lambda x: float(x) / 100.0 * len(self.minions)
|
||||
try:
|
||||
if sys.version_info.major == 3:
|
||||
batch_is_str = isinstance(self.opts['batch'], str)
|
||||
else:
|
||||
batch_is_str = isinstance(self.opts['batch'], str) or isinstance(self.opts['batch'], unicode)
|
||||
if batch_is_str and '%' in self.opts['batch']:
|
||||
if isinstance(self.opts['batch'], six.string_types) and '%' in self.opts['batch']:
|
||||
res = partition(float(self.opts['batch'].strip('%')))
|
||||
if res < 1:
|
||||
return int(math.ceil(res))
|
||||
|
|
Loading…
Add table
Reference in a new issue