mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[microdecision] Fix case where stdinfo is not provided
This commit is contained in:
parent
c9d5f9a04a
commit
0a300e50d7
1 changed files with 6 additions and 3 deletions
|
@ -65,7 +65,8 @@ def call_async_output(args, callback, **kwargs):
|
||||||
# if command does not write in the stdinfo pipe...)
|
# if command does not write in the stdinfo pipe...)
|
||||||
stdinfo_f = os.open(stdinfo, os.O_RDONLY | os.O_NONBLOCK)
|
stdinfo_f = os.open(stdinfo, os.O_RDONLY | os.O_NONBLOCK)
|
||||||
else:
|
else:
|
||||||
kwargs.pop("stdinfo")
|
if "stdinfo" in kwargs:
|
||||||
|
kwargs.pop("stdinfo")
|
||||||
stdinfo = None
|
stdinfo = None
|
||||||
|
|
||||||
# Validate callback argument
|
# Validate callback argument
|
||||||
|
@ -98,13 +99,15 @@ def call_async_output(args, callback, **kwargs):
|
||||||
# this way is not 100% perfect but should do it
|
# this way is not 100% perfect but should do it
|
||||||
stdout_consum.process_next_line()
|
stdout_consum.process_next_line()
|
||||||
stderr_consum.process_next_line()
|
stderr_consum.process_next_line()
|
||||||
stdinfo_consum.process_next_line()
|
if stdinfo:
|
||||||
|
stdinfo_consum.process_next_line()
|
||||||
time.sleep(.1)
|
time.sleep(.1)
|
||||||
stderr_reader.join()
|
stderr_reader.join()
|
||||||
# clear the queues
|
# clear the queues
|
||||||
stdout_consum.process_current_queue()
|
stdout_consum.process_current_queue()
|
||||||
stderr_consum.process_current_queue()
|
stderr_consum.process_current_queue()
|
||||||
stdinfo_consum.process_current_queue()
|
if stdinfo:
|
||||||
|
stdinfo_consum.process_current_queue()
|
||||||
else:
|
else:
|
||||||
while not stdout_reader.eof():
|
while not stdout_reader.eof():
|
||||||
stdout_consum.process_current_queue()
|
stdout_consum.process_current_queue()
|
||||||
|
|
Loading…
Reference in a new issue