mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +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)):
|
if self.timeout and not isinstance(self.timeout, (int, float)):
|
||||||
raise salt.exceptions.TimedProcTimeoutError('Error: timeout {0} must be a number'.format(self.timeout))
|
raise salt.exceptions.TimedProcTimeoutError('Error: timeout {0} must be a number'.format(self.timeout))
|
||||||
if six.PY2 and kwargs.get('shell', False):
|
if kwargs.get('shell', False):
|
||||||
args = salt.utils.stringutils.to_bytes(args)
|
args = salt.utils.data.decode(args, to_str=True)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.process = subprocess.Popen(args, **kwargs)
|
self.process = subprocess.Popen(args, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user