Skip to content

Commit cdd846e

Browse files
committed
capture: skip starting domain if desktop_read_delay is null
1 parent 9e41da1 commit cdd846e

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

oswatcher/capture.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,19 @@ def protocol(environment):
8181
config = environment.configuration['configuration']
8282
context.trigger('protocol_start')
8383
context.trigger('offline')
84-
# start domain
85-
logging.info("Starting the domain")
86-
context.poweron()
87-
# wait until desktop is ready
88-
logging.debug("Waiting %d seconds for desktop to be ready",
89-
config['desktop_ready_delay'])
90-
time.sleep(config['desktop_ready_delay'])
91-
context.trigger('desktop_ready')
92-
# shutdown
93-
logging.info("Shutting down the domain")
94-
context.poweroff()
84+
desktop_ready_delay = config['desktop_ready_delay']
85+
if desktop_ready_delay > 0:
86+
# start domain
87+
logging.info("Starting the domain")
88+
context.poweron()
89+
# wait until desktop is ready
90+
logging.debug("Waiting %d seconds for desktop to be ready",
91+
config['desktop_ready_delay'])
92+
time.sleep(config['desktop_ready_delay'])
93+
context.trigger('desktop_ready')
94+
# shutdown
95+
logging.info("Shutting down the domain")
96+
context.poweroff()
9597
context.trigger('protocol_end')
9698

9799

0 commit comments

Comments
 (0)