From 39f3834a1f487625b0816b577cedeedd3b076f59 Mon Sep 17 00:00:00 2001 From: gong yong sheng Date: Thu, 5 Jan 2017 09:59:11 +0000 Subject: [PATCH] Add guru meditation support After this, kill -s SIGUSR2 will make tacker server report its running configuration. Change-Id: I3823c6d79f264e570f4696cd644a5607558e577d --- ...u-meditation-support-66a467c1c2746570.yaml | 6 ++++ requirements.txt | 1 + tacker/cmd/__init__.py | 28 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 releasenotes/notes/guru-meditation-support-66a467c1c2746570.yaml diff --git a/releasenotes/notes/guru-meditation-support-66a467c1c2746570.yaml b/releasenotes/notes/guru-meditation-support-66a467c1c2746570.yaml new file mode 100644 index 000000000..4e7bc5efc --- /dev/null +++ b/releasenotes/notes/guru-meditation-support-66a467c1c2746570.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add Guru Meditation support. + Command "kill -s SIGUSR2 " + will make tacker server emit running configuration. diff --git a/requirements.txt b/requirements.txt index 7aab5a510..2a607e7ba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -32,6 +32,7 @@ oslo.log>=3.11.0 # Apache-2.0 oslo.messaging>=5.14.0 # Apache-2.0 oslo.middleware>=3.0.0 # Apache-2.0 oslo.policy>=1.17.0 # Apache-2.0 +oslo.reports>=0.6.0 # Apache-2.0 oslo.rootwrap>=5.0.0 # Apache-2.0 oslo.serialization>=1.10.0 # Apache-2.0 oslo.service>=1.10.0 # Apache-2.0 diff --git a/tacker/cmd/__init__.py b/tacker/cmd/__init__.py index e69de29bb..26d369958 100644 --- a/tacker/cmd/__init__.py +++ b/tacker/cmd/__init__.py @@ -0,0 +1,28 @@ +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import logging as sys_logging + +from oslo_reports import guru_meditation_report as gmr + +from tacker import version + +# During the call to gmr.TextGuruMeditation.setup_autorun(), Guru Meditation +# Report tries to start logging. Set a handler here to accommodate this. +logger = sys_logging.getLogger(None) +if not logger.handlers: + logger.addHandler(sys_logging.StreamHandler()) + +_version_string = version.version_info.release_string() +gmr.TextGuruMeditation.setup_autorun(version=_version_string)