Merge pull request #35338 from cachedout/fixup_35293

Refine arg conditioning for py2/py3 handling
This commit is contained in:
Mike Place 2016-08-10 23:58:51 +09:00 committed by GitHub
commit e79363498a

View File

@ -8,6 +8,9 @@ from __future__ import absolute_import
import re
import inspect
# Import salt libs
import salt.utils.jid
# Import 3rd-party libs
import salt.ext.six as six
@ -24,7 +27,11 @@ def condition_input(args, kwargs):
'''
ret = []
for arg in args:
ret.append(arg)
if (six.PY3 and isinstance(arg, six.integer_types) and salt.utils.jid.is_jid(str(arg))) or \
(six.PY2 and isinstance(arg, long)): # pylint: disable=incompatible-py3-code
ret.append(str(arg))
else:
ret.append(arg)
if isinstance(kwargs, dict) and kwargs:
kw_ = {'__kwarg__': True}
for key, val in six.iteritems(kwargs):