From 34b9fa54ec162f35456fd1eaf11fe338fe3441ee Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 18 Nov 2013 15:53:46 +0100 Subject: [PATCH] Move dispatcher a level up Dispatcher as it is designed now is used by both collector and agent-notification, so let's move it level upper. This makes a more flat hierarchy. Change-Id: I681bf58f0b26cca22a48e6655db2547e59f9e805 --- ceilometer/{collector => }/dispatcher/__init__.py | 0 ceilometer/{collector => }/dispatcher/database.py | 2 +- ceilometer/{collector => }/dispatcher/file.py | 2 +- ceilometer/tests/{collector => }/dispatcher/__init__.py | 0 ceilometer/tests/{collector => }/dispatcher/test_db.py | 4 +--- ceilometer/tests/{collector => }/dispatcher/test_file.py | 5 +---- doc/source/install/manual.rst | 4 ++-- etc/ceilometer/ceilometer.conf.sample | 2 +- setup.cfg | 4 ++-- 9 files changed, 9 insertions(+), 14 deletions(-) rename ceilometer/{collector => }/dispatcher/__init__.py (100%) rename ceilometer/{collector => }/dispatcher/database.py (98%) rename ceilometer/{collector => }/dispatcher/file.py (98%) rename ceilometer/tests/{collector => }/dispatcher/__init__.py (100%) rename ceilometer/tests/{collector => }/dispatcher/test_db.py (97%) rename ceilometer/tests/{collector => }/dispatcher/test_file.py (97%) diff --git a/ceilometer/collector/dispatcher/__init__.py b/ceilometer/dispatcher/__init__.py similarity index 100% rename from ceilometer/collector/dispatcher/__init__.py rename to ceilometer/dispatcher/__init__.py diff --git a/ceilometer/collector/dispatcher/database.py b/ceilometer/dispatcher/database.py similarity index 98% rename from ceilometer/collector/dispatcher/database.py rename to ceilometer/dispatcher/database.py index 40dde68cf..9b98aa97d 100644 --- a/ceilometer/collector/dispatcher/database.py +++ b/ceilometer/dispatcher/database.py @@ -16,7 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. -from ceilometer.collector import dispatcher +from ceilometer import dispatcher from ceilometer.openstack.common import log from ceilometer.openstack.common import timeutils from ceilometer.publisher import rpc as publisher_rpc diff --git a/ceilometer/collector/dispatcher/file.py b/ceilometer/dispatcher/file.py similarity index 98% rename from ceilometer/collector/dispatcher/file.py rename to ceilometer/dispatcher/file.py index cf27edc79..bd83e3222 100644 --- a/ceilometer/collector/dispatcher/file.py +++ b/ceilometer/dispatcher/file.py @@ -21,7 +21,7 @@ import logging.handlers from oslo.config import cfg -from ceilometer.collector import dispatcher +from ceilometer import dispatcher file_dispatcher_opts = [ cfg.StrOpt('file_path', diff --git a/ceilometer/tests/collector/dispatcher/__init__.py b/ceilometer/tests/dispatcher/__init__.py similarity index 100% rename from ceilometer/tests/collector/dispatcher/__init__.py rename to ceilometer/tests/dispatcher/__init__.py diff --git a/ceilometer/tests/collector/dispatcher/test_db.py b/ceilometer/tests/dispatcher/test_db.py similarity index 97% rename from ceilometer/tests/collector/dispatcher/test_db.py rename to ceilometer/tests/dispatcher/test_db.py index fe97d30f5..257e20117 100644 --- a/ceilometer/tests/collector/dispatcher/test_db.py +++ b/ceilometer/tests/dispatcher/test_db.py @@ -15,13 +15,11 @@ # 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/collector/dispatcher/database.py -""" import datetime import mock -from ceilometer.collector.dispatcher import database +from ceilometer.dispatcher import database from ceilometer.openstack.common.fixture import config from ceilometer.openstack.common import test from ceilometer.publisher import rpc diff --git a/ceilometer/tests/collector/dispatcher/test_file.py b/ceilometer/tests/dispatcher/test_file.py similarity index 97% rename from ceilometer/tests/collector/dispatcher/test_file.py rename to ceilometer/tests/dispatcher/test_file.py index cfba4b69f..1699c9bc9 100644 --- a/ceilometer/tests/collector/dispatcher/test_file.py +++ b/ceilometer/tests/dispatcher/test_file.py @@ -15,14 +15,11 @@ # 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/collector/dispatcher/file.py -""" - import logging.handlers import os import tempfile -from ceilometer.collector.dispatcher import file +from ceilometer.dispatcher import file from ceilometer.openstack.common.fixture import config from ceilometer.openstack.common import test from ceilometer.publisher import rpc diff --git a/doc/source/install/manual.rst b/doc/source/install/manual.rst index 4f1fe0bd9..ebfad12e1 100644 --- a/doc/source/install/manual.rst +++ b/doc/source/install/manual.rst @@ -499,8 +499,8 @@ configured in ceilometer configuration file. These two dispatchers are shipped in the Ceilometer egg and defined in the entry_points as follows:: [ceilometer.dispatcher] - file = ceilometer.collector.dispatcher.file:FileDispatcher - database = ceilometer.collector.dispatcher.database:DatabaseDispatcher + file = ceilometer.dispatcher.file:FileDispatcher + database = ceilometer.dispatcher.database:DatabaseDispatcher To use both dispatchers on a Ceilometer collector service, add the following line in file ceilometer.conf:: diff --git a/etc/ceilometer/ceilometer.conf.sample b/etc/ceilometer/ceilometer.conf.sample index 159b76af4..613172a47 100644 --- a/etc/ceilometer/ceilometer.conf.sample +++ b/etc/ceilometer/ceilometer.conf.sample @@ -746,7 +746,7 @@ [dispatcher_file] # -# Options defined in ceilometer.collector.dispatcher.file +# Options defined in ceilometer.dispatcher.file # # Name and the location of the file to record meters. (string diff --git a/setup.cfg b/setup.cfg index 8e0dc0e4e..c2a026093 100644 --- a/setup.cfg +++ b/setup.cfg @@ -127,8 +127,8 @@ console_scripts = ceilometer-alarm-notifier = ceilometer.alarm.service:alarm_notifier ceilometer.dispatcher = - database = ceilometer.collector.dispatcher.database:DatabaseDispatcher - file = ceilometer.collector.dispatcher.file:FileDispatcher + database = ceilometer.dispatcher.database:DatabaseDispatcher + file = ceilometer.dispatcher.file:FileDispatcher [build_sphinx]