summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSam Doran <sdoran@redhat.com>2021-02-05 15:50:33 -0500
committerGitHub <noreply@github.com>2021-02-05 14:50:33 -0600
commite3c08d001d8ae787b95ceeacd07938f751f6b516 (patch)
tree0e66fe02217421edd22911cef33bb5be0ecd6334 /lib
parent3361517fa964222128e232eec20107b3b6547b70 (diff)
downloadansible-e3c08d001d8ae787b95ceeacd07938f751f6b516.tar.gz
[stable-2.9] pause - adjust warning when run in background (#73182) (#73230)
When the pause module is run in the background and seconds parameter is provided, do not warn. * Add tests * Fix existing tests The test wasn't failing when it should have. (cherry picked from commit 0e6c334115) Co-authored-by: Sam Doran <sdoran@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/plugins/action/pause.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/plugins/action/pause.py b/lib/ansible/plugins/action/pause.py
index b7731ff21e..961b1e0c55 100644
--- a/lib/ansible/plugins/action/pause.py
+++ b/lib/ansible/plugins/action/pause.py
@@ -231,7 +231,8 @@ class ActionModule(ActionBase):
while True:
if not interactive:
- display.warning("Not waiting for response to prompt as stdin is not interactive")
+ if seconds is None:
+ display.warning("Not waiting for response to prompt as stdin is not interactive")
if seconds is not None:
# Give the signal handler enough time to timeout
time.sleep(seconds + 1)