diff --git a/ceilometer/cmd/agent_ipmi.py b/ceilometer/cmd/agent_ipmi.py deleted file mode 100644 index eb57e75b..00000000 --- a/ceilometer/cmd/agent_ipmi.py +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright 2014 OpenStack Foundation -# -# 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 ceilometer.ipmi import manager -from ceilometer.openstack.common import service as os_service -from ceilometer import service - - -def main(): - service.prepare_service() - os_service.launch(manager.AgentManager()).wait() diff --git a/ceilometer/cmd/polling.py b/ceilometer/cmd/polling.py index afa65fce..d642a35d 100644 --- a/ceilometer/cmd/polling.py +++ b/ceilometer/cmd/polling.py @@ -39,11 +39,10 @@ class MultiChoicesOpt(cfg.Opt): kwargs['choices'] = choices return kwargs -# todo(dbelova): add ipmi agent here as well CLI_OPTS = [ MultiChoicesOpt('polling-namespaces', default=['compute', 'central'], - choices=['compute', 'central'], + choices=['compute', 'central', 'ipmi'], dest='polling_namespaces', help='Polling namespace(s) to be used while ' 'resource polling'), @@ -73,3 +72,8 @@ def main_compute(): def main_central(): service.prepare_service() os_service.launch(manager.AgentManager(['central'])).wait() + + +def main_ipmi(): + service.prepare_service() + os_service.launch(manager.AgentManager(['ipmi'])).wait() diff --git a/ceilometer/ipmi/manager.py b/ceilometer/ipmi/manager.py deleted file mode 100644 index 8a386f79..00000000 --- a/ceilometer/ipmi/manager.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2014 Intel -# -# Author: Zhai Edwin -# -# 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 ceilometer.agent import manager - - -class AgentManager(manager.AgentManager): - - def __init__(self): - super(AgentManager, self).__init__('ipmi') diff --git a/ceilometer/tests/ipmi/pollsters/base.py b/ceilometer/tests/ipmi/pollsters/base.py index 4b8e5883..121e1efe 100644 --- a/ceilometer/tests/ipmi/pollsters/base.py +++ b/ceilometer/tests/ipmi/pollsters/base.py @@ -20,8 +20,8 @@ import mock from oslotest import mockpatch import six -from ceilometer.ipmi import manager -import ceilometer.tests.base as base +from ceilometer.agent import manager +from ceilometer.tests import base @six.add_metaclass(abc.ABCMeta) @@ -54,7 +54,7 @@ class TestPollsterBase(base.BaseTestCase): 'ceilometer.ipmi.platform.ipmi_sensor.IPMISensor', return_value=nm)) - self.mgr = manager.AgentManager() + self.mgr = manager.AgentManager(['ipmi']) self.pollster = self.make_pollster() diff --git a/ceilometer/tests/ipmi/test_manager.py b/ceilometer/tests/ipmi/test_manager.py deleted file mode 100644 index 72b8f96b..00000000 --- a/ceilometer/tests/ipmi/test_manager.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2014 Intel Corp. -# -# Author: Zhai Edwin -# -# 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. -"""Tests for ceilometer/ipmi/manager.py -""" - -from ceilometer.ipmi import manager - -import mock -from oslotest import base - -from ceilometer.tests.agent import agentbase - - -class TestManager(base.BaseTestCase): - - @mock.patch('ceilometer.pipeline.setup_pipeline', mock.MagicMock()) - @mock.patch('ceilometer.ipmi.pollsters.node._Base.__init__', - mock.Mock(return_value=None)) - @mock.patch('ceilometer.ipmi.pollsters.sensor.SensorPollster.__init__', - mock.Mock(return_value=None)) - def test_load_plugins(self): - mgr = manager.AgentManager() - self.assertIsNotNone(list(mgr.extensions)) - - -class TestRunTasks(agentbase.BaseAgentManagerTestCase): - - @staticmethod - @mock.patch('ceilometer.ipmi.pollsters.node._Base.__init__', - mock.Mock(return_value=None)) - @mock.patch('ceilometer.ipmi.pollsters.sensor.SensorPollster.__init__', - mock.Mock(return_value=None)) - def create_manager(): - return manager.AgentManager() - - def setUp(self): - self.source_resources = True - super(TestRunTasks, self).setUp() diff --git a/setup.cfg b/setup.cfg index f2a5716f..95c559d5 100755 --- a/setup.cfg +++ b/setup.cfg @@ -294,7 +294,7 @@ console_scripts = ceilometer-agent-compute = ceilometer.cmd.polling:main_compute ceilometer-polling = ceilometer.cmd.polling:main ceilometer-agent-notification = ceilometer.cmd.agent_notification:main - ceilometer-agent-ipmi = ceilometer.cmd.agent_ipmi:main + ceilometer-agent-ipmi = ceilometer.cmd.polling:main_ipmi ceilometer-send-sample = ceilometer.cli:send_sample ceilometer-dbsync = ceilometer.cmd.storage:dbsync ceilometer-expirer = ceilometer.cmd.storage:expirer