Merge "guru_meditation_report: Use SIGUSR2 instead of SIGUSR1"

This commit is contained in:
Jenkins 2015-09-24 15:57:15 +00:00 committed by Gerrit Code Review
commit 8287db165c
2 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ Then, you can do
.. code-block:: bash
$ kill -USR1 $SERVICE_PID
$ kill -USR2 $SERVICE_PID
and get a Guru Meditation Report in the file or terminal
where stderr is logged for that given service.
@ -128,9 +128,9 @@ class GuruMeditation(object):
:param conf: Configuration object, managed by the caller.
"""
if not signum and hasattr(signal, 'SIGUSR1'):
# SIGUSR1 is not supported on all platforms
signum = signal.SIGUSR1
if not signum and hasattr(signal, 'SIGUSR2'):
# SIGUSR2 is not supported on all platforms
signum = signal.SIGUSR2
if signum:
if log_dir is None and conf is not None:

View File

@ -165,7 +165,7 @@ class TestGuruMeditationReport(base.BaseTestCase):
self.old_stderr = sys.stderr
sys.stderr = six.StringIO()
os.kill(os.getpid(), signal.SIGUSR1)
os.kill(os.getpid(), signal.SIGUSR2)
self.assertIn('Guru Meditation', sys.stderr.getvalue())
@mock.patch('oslo_utils.timeutils.utcnow',
@ -175,7 +175,7 @@ class TestGuruMeditationReport(base.BaseTestCase):
gmr.TextGuruMeditation.setup_autorun(
FakeVersionObj(), "fake-service", log_dir)
os.kill(os.getpid(), signal.SIGUSR1)
os.kill(os.getpid(), signal.SIGUSR2)
with open(os.path.join(
log_dir, "fake-service_gurumeditation_20140101120000")) as df:
self.assertIn('Guru Meditation', df.read())