mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
termination handling
- moved to base cli class to handle centrally and duplicate less code - now avoids duplication and reiteration of signal handler by reassigning it - left note on how to do non-graceful in case we add in future as I won't remember everything i did here and don't want to 'relearn' it.
This commit is contained in:
parent
371c7315b0
commit
38120c1075
3 changed files with 19 additions and 22 deletions
|
@ -19,11 +19,7 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import getpass
|
||||
import locale
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
|
||||
from ansible.compat.six import string_types
|
||||
|
||||
|
@ -32,8 +28,6 @@ from ansible.executor.task_queue_manager import TaskQueueManager
|
|||
from ansible.playbook import Playbook
|
||||
from ansible.template import Templar
|
||||
|
||||
from ansible.utils.unicode import to_unicode
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
except ImportError:
|
||||
|
@ -69,8 +63,6 @@ class PlaybookExecutor:
|
|||
may limit the runs to serialized groups, etc.
|
||||
'''
|
||||
|
||||
signal.signal(signal.SIGTERM, self._terminate)
|
||||
|
||||
result = 0
|
||||
entrylist = []
|
||||
entry = {}
|
||||
|
@ -207,10 +199,6 @@ 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