mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #35338 from cachedout/fixup_35293
Refine arg conditioning for py2/py3 handling
This commit is contained in:
commit
e79363498a
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user