mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
even simpler condition tree for pause
This commit is contained in:
parent
dc80bc8929
commit
29cd72b7d8
1 changed files with 6 additions and 9 deletions
|
@ -115,16 +115,13 @@ class ActionModule(ActionBase):
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
if seconds:
|
key_pressed = self._connection._new_stdin.read(1)
|
||||||
key_pressed = self._connection._new_stdin.read(1)
|
if key_pressed == '\x03':
|
||||||
if key_pressed == '\x03':
|
raise KeyboardInterrupt
|
||||||
raise KeyboardInterrupt
|
|
||||||
else:
|
if not seconds:
|
||||||
# read key presses and act accordingly
|
# read key presses and act accordingly
|
||||||
key_pressed = self._connection._new_stdin.read(1)
|
if key_pressed == '\r':
|
||||||
if key_pressed == '\x03':
|
|
||||||
raise KeyboardInterrupt
|
|
||||||
elif key_pressed == '\r':
|
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
result['user_input'] += key_pressed
|
result['user_input'] += key_pressed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue