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
d47d0b1d
Commit
d47d0b1d
authored
Aug 06, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now continue/abort mode allows ignoring other input
parent
a555a065
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
lib/ansible/plugins/action/pause.py
+10
-4
No files found.
lib/ansible/plugins/action/pause.py
View file @
d47d0b1d
...
...
@@ -135,11 +135,10 @@ class ActionModule(ActionBase):
if
seconds
is
not
None
:
signal
.
alarm
(
0
)
self
.
_display
.
display
(
"Press 'C' to continue the play or 'A' to abort
\r
"
),
key_pressed
=
self
.
_connection
.
_new_stdin
.
read
(
1
)
if
key_pressed
.
lower
()
==
'a'
:
raise
AnsibleError
(
'user requested abort!'
)
elif
key_pressed
.
lower
()
==
'c'
:
if
self
.
_c_or_a
():
break
else
:
raise
AnsibleError
(
'user requested abort!'
)
except
AnsibleTimeoutExceeded
:
# this is the exception we expect when the alarm signal
...
...
@@ -163,3 +162,10 @@ class ActionModule(ActionBase):
return
result
def
_c_or_a
(
self
):
while
True
:
key_pressed
=
self
.
_connection
.
_new_stdin
.
read
(
1
)
if
key_pressed
.
lower
()
==
'a'
:
return
False
elif
key_pressed
.
lower
()
==
'c'
:
return
True
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