mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
TimedProc: Don't assume args is a string
Both a string and a list of args are supported
This commit is contained in:
parent
87de250993
commit
cbf05c8481
@ -40,8 +40,8 @@ class TimedProc(object):
|
||||
|
||||
if self.timeout and not isinstance(self.timeout, (int, float)):
|
||||
raise salt.exceptions.TimedProcTimeoutError('Error: timeout {0} must be a number'.format(self.timeout))
|
||||
if six.PY2 and kwargs.get('shell', False):
|
||||
args = salt.utils.stringutils.to_bytes(args)
|
||||
if kwargs.get('shell', False):
|
||||
args = salt.utils.data.decode(args, to_str=True)
|
||||
|
||||
try:
|
||||
self.process = subprocess.Popen(args, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user