Add support for Guru Meditation Reports for LBaaS agents

The change consolidates common actions taken by all services under
neutron_lbaas/cmd/... in a way that reflects the approach taken in
neutron repo. This currently includes GMR initialization and eventlet
monkey patching.

Added oslo.reports dependency since now we explicitly require it.

Change-Id: Ia76b113648536f6786de4029376df2caa25036d1
Implements: blueprint guru-meditation-report
This commit is contained in:
Ihar Hrachyshka 2016-03-03 14:08:13 +01:00
parent e8fc26573b
commit 8d3dd9cce4
7 changed files with 66 additions and 9 deletions

View File

@ -15,10 +15,6 @@
import sys
import eventlet
eventlet.monkey_patch()
from neutron.agent.common import config
from neutron.agent.linux import interface
from neutron.common import config as common_config

View File

@ -0,0 +1,29 @@
# 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 eventlet
eventlet.monkey_patch()
import logging as sys_logging
from oslo_reports import guru_meditation_report as gmr
from neutron_lbaas 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)

View File

@ -0,0 +1,17 @@
# 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.
from neutron_lbaas.services.loadbalancer.agent import agent
def main():
agent.main()

View File

@ -0,0 +1,17 @@
# 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.
from neutron_lbaas.agent import agent
def main():
agent.main()

View File

@ -14,9 +14,6 @@
import sys
import eventlet
eventlet.monkey_patch()
from neutron.agent.common import config
from neutron.agent.linux import interface
from neutron.common import config as common_config

View File

@ -14,6 +14,7 @@ oslo.config>=3.7.0 # Apache-2.0
oslo.db>=4.1.0 # Apache-2.0
oslo.log>=1.14.0 # Apache-2.0
oslo.messaging>=4.0.0 # Apache-2.0
oslo.reports>=0.6.0 # Apache-2.0
oslo.serialization>=1.10.0 # Apache-2.0
oslo.service>=1.0.0 # Apache-2.0
oslo.utils>=3.5.0 # Apache-2.0

View File

@ -29,8 +29,8 @@ setup-hooks =
[entry_points]
console_scripts =
neutron-lbaas-agent = neutron_lbaas.services.loadbalancer.agent.agent:main
neutron-lbaasv2-agent = neutron_lbaas.agent.agent:main
neutron-lbaas-agent = neutron_lbaas.cmd.lbaas_agent:main
neutron-lbaasv2-agent = neutron_lbaas.cmd.lbaasv2_agent:main
device_drivers =
# These are for backwards compat with Juno loadbalancer service provider configuration values
neutron.services.loadbalancer.drivers.a10networks.driver_v1.ThunderDriver = neutron_lbaas.services.loadbalancer.drivers.a10networks.driver_v1:ThunderDriver