mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Revert "centralized TERM signal handling"
This reverts commit 5a88478ccc
.
is WIP, not ready for use yet
This commit is contained in:
parent
2adddac94c
commit
d9dcb2a427
3 changed files with 15 additions and 9 deletions
|
@ -22,6 +22,7 @@ __metaclass__ = type
|
|||
import getpass
|
||||
import locale
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
|
||||
from ansible.compat.six import string_types
|
||||
|
@ -68,6 +69,8 @@ class PlaybookExecutor:
|
|||
may limit the runs to serialized groups, etc.
|
||||
'''
|
||||
|
||||
signal.signal(signal.SIGTERM, self._terminate)
|
||||
|
||||
result = 0
|
||||
entrylist = []
|
||||
entry = {}
|
||||
|
@ -204,6 +207,10 @@ class PlaybookExecutor:
|
|||
|
||||
return result
|
||||
|
||||
def _terminate(self, signum=None, framenum=None):
|
||||
display.debug("Termination signal detected, shutting down gracefully")
|
||||
raise SystemExit
|
||||
|
||||
def _get_serialized_batches(self, play):
|
||||
'''
|
||||
Returns a list of hosts, subdivided into batches based on
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue