Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
f7707d88
Commit
f7707d88
authored
Aug 06, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
brought user_input back to pause
parent
00b1a2c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lib/ansible/plugins/action/pause.py
+7
-3
No files found.
lib/ansible/plugins/action/pause.py
View file @
f7707d88
...
@@ -90,6 +90,7 @@ class ActionModule(ActionBase):
...
@@ -90,6 +90,7 @@ class ActionModule(ActionBase):
start
=
time
.
time
()
start
=
time
.
time
()
result
[
'start'
]
=
str
(
datetime
.
datetime
.
now
())
result
[
'start'
]
=
str
(
datetime
.
datetime
.
now
())
result
[
'user_input'
]
=
''
try
:
try
:
if
seconds
is
not
None
:
if
seconds
is
not
None
:
...
@@ -97,10 +98,10 @@ class ActionModule(ActionBase):
...
@@ -97,10 +98,10 @@ class ActionModule(ActionBase):
signal
.
signal
(
signal
.
SIGALRM
,
timeout_handler
)
signal
.
signal
(
signal
.
SIGALRM
,
timeout_handler
)
signal
.
alarm
(
seconds
)
signal
.
alarm
(
seconds
)
# show the prompt
# show the prompt
print
(
"Pausing for
%
d seconds"
%
seconds
)
self
.
_display
.
display
(
"Pausing for
%
d seconds"
%
seconds
)
print
(
"(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
\r
"
),
self
.
_display
.
display
(
"(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
\r
"
),
else
:
else
:
print
(
prompt
)
self
.
_display
.
display
(
prompt
)
# save the attributes on the existing (duped) stdin so
# save the attributes on the existing (duped) stdin so
# that we can restore them later after we set raw mode
# that we can restore them later after we set raw mode
...
@@ -127,6 +128,9 @@ class ActionModule(ActionBase):
...
@@ -127,6 +128,9 @@ class ActionModule(ActionBase):
raise
KeyboardInterrupt
raise
KeyboardInterrupt
elif
key_pressed
==
'
\r
'
:
elif
key_pressed
==
'
\r
'
:
break
break
else
:
result
[
'user_input'
]
+=
key_pressed
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
# cancel the previously set alarm signal
# cancel the previously set alarm signal
if
seconds
is
not
None
:
if
seconds
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment