Skip to content

Commit ccfb9e4

Browse files
committed
change Live Response default to wait for command completion in create_process
1 parent 8289539 commit ccfb9e4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cbapi/live_response_api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def kill_process(self, pid):
284284
return True
285285

286286
def create_process(self, command_string, wait_for_output=True, remote_output_file_name=None,
287-
working_directory=None, wait_timeout=30):
287+
working_directory=None, wait_timeout=30, wait_for_completion=True):
288288
"""
289289
Create a new process with the specified command string.
290290
@@ -296,10 +296,11 @@ def create_process(self, command_string, wait_for_output=True, remote_output_fil
296296
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
297297
298298
:param str command_string: command string used for the create process operation
299-
:param bool wait_for_output: Block on output from the new process
299+
:param bool wait_for_output: Block on output from the new process (execute in foreground)
300300
:param str remote_output_file_name: The remote output file name used for process output
301301
:param str working_directory: The working directory of the create process operation
302302
:param int wait_timeout: Time out used for this live response command
303+
:param bool wait_for_completion: Wait until the process is completed before returning
303304
:return: returns the output of the command string
304305
:rtype: str
305306
"""
@@ -310,7 +311,7 @@ def create_process(self, command_string, wait_for_output=True, remote_output_fil
310311
# - get the temporary file from the endpoint
311312
# - delete the temporary file
312313

313-
data = {"name": "create process", "object": command_string, "wait": False}
314+
data = {"name": "create process", "object": command_string, "wait": wait_for_completion}
314315

315316
if wait_for_output and not remote_output_file_name:
316317
randfilename = self._random_file_name()

0 commit comments

Comments
 (0)