Build ceilometer-agent and ceilometer-collector
Change-Id: I0cc5b163ac638f33397e7e7a9c046dca3e2939e9 Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
This commit is contained in:
parent
73c9150afe
commit
5717e9c5c9
@ -32,8 +32,8 @@ if __name__ == '__main__':
|
|||||||
flags.FLAGS(sys.argv)
|
flags.FLAGS(sys.argv)
|
||||||
logging.setup()
|
logging.setup()
|
||||||
utils.monkey_patch()
|
utils.monkey_patch()
|
||||||
server = service.Service.create(binary='ceilometer-nova-compute',
|
server = service.Service.create(binary='ceilometer-agent',
|
||||||
topic='ceilometer',
|
topic='ceilometer',
|
||||||
manager='ceilometer.nova.manager.ComputeManager')
|
manager='ceilometer.agent.manager.AgentManager')
|
||||||
service.serve(server)
|
service.serve(server)
|
||||||
service.wait()
|
service.wait()
|
@ -32,7 +32,7 @@ if __name__ == '__main__':
|
|||||||
flags.FLAGS(sys.argv)
|
flags.FLAGS(sys.argv)
|
||||||
logging.setup()
|
logging.setup()
|
||||||
utils.monkey_patch()
|
utils.monkey_patch()
|
||||||
server = service.Service.create(binary='ceilometer-nova-instance',
|
server = service.Service.create(binary='ceilometer-collector',
|
||||||
topic='ceilometer',
|
topic='ceilometer',
|
||||||
manager='ceilometer.collector.manager.CollectorManager')
|
manager='ceilometer.collector.manager.CollectorManager')
|
||||||
service.serve(server)
|
service.serve(server)
|
@ -30,8 +30,9 @@ FLAGS = flags.FLAGS
|
|||||||
LOG = logging.getLogger('nova.' + __name__)
|
LOG = logging.getLogger('nova.' + __name__)
|
||||||
|
|
||||||
|
|
||||||
class ComputeManager(manager.Manager):
|
class AgentManager(manager.Manager):
|
||||||
def _get_disks(self, conn, instance):
|
@staticmethod
|
||||||
|
def _get_disks(conn, instance):
|
||||||
"""Get disks of an instance, only used to bypass bug#998089."""
|
"""Get disks of an instance, only used to bypass bug#998089."""
|
||||||
domain = conn._conn.lookupByName(instance)
|
domain = conn._conn.lookupByName(instance)
|
||||||
tree = etree.fromstring(domain.XMLDesc(0))
|
tree = etree.fromstring(domain.XMLDesc(0))
|
2
setup.py
2
setup.py
@ -29,7 +29,7 @@ setuptools.setup(
|
|||||||
packages=setuptools.find_packages(exclude=['bin']),
|
packages=setuptools.find_packages(exclude=['bin']),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
test_suite='nose.collector',
|
test_suite='nose.collector',
|
||||||
scripts=['bin/ceilometer-nova-compute'],
|
scripts=['bin/ceilometer-agent', 'bin/ceilometer-collector'],
|
||||||
py_modules=[],
|
py_modules=[],
|
||||||
entry_points={
|
entry_points={
|
||||||
'ceilometer.collector.compute': [
|
'ceilometer.collector.compute': [
|
||||||
|
0
tests/agent/__init__.py
Normal file
0
tests/agent/__init__.py
Normal file
55
tests/agent/test_manager.py
Normal file
55
tests/agent/test_manager.py
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- encoding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright © 2012 eNovance <licensing@enovance.com>
|
||||||
|
#
|
||||||
|
# Author: Julien Danjou <julien@danjou.info>
|
||||||
|
#
|
||||||
|
# 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 manager.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# import unittest
|
||||||
|
# import mox
|
||||||
|
# import stubout
|
||||||
|
|
||||||
|
# import nova.tests.fakelibvirt as libvirt
|
||||||
|
from nova import context
|
||||||
|
from nova import flags
|
||||||
|
from nova import test
|
||||||
|
from nova import db
|
||||||
|
from nova import test
|
||||||
|
|
||||||
|
from ceilometer.agent import manager
|
||||||
|
|
||||||
|
class TestAgentManager(test.TestCase):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.context = context.RequestContext('admin', 'admin', is_admin=True)
|
||||||
|
self.manager = manager.AgentManager()
|
||||||
|
super(TestAgentManager, self).setUp()
|
||||||
|
|
||||||
|
def test_fetch_diskio(self):
|
||||||
|
self.manager._fetch_diskio(self.context)
|
||||||
|
|
||||||
|
def test_fetch_diskio_with_libvirt_non_existent_instance(self):
|
||||||
|
flags.FLAGS.connection_type = 'libvirt'
|
||||||
|
|
||||||
|
instance = db.instance_create(self.context, {})
|
||||||
|
|
||||||
|
self.mox.StubOutWithMock(self.manager.db, 'instance_get_all_by_host')
|
||||||
|
self.manager.db.instance_get_all_by_host(self.context, self.manager.host).AndReturn([instance])
|
||||||
|
|
||||||
|
self.mox.ReplayAll()
|
||||||
|
|
||||||
|
self.manager._fetch_diskio(self.context)
|
Loading…
Reference in New Issue
Block a user