Migrate monasca-ceilometer to be liberty compatible

List of changes:
* Changed oslo-incubator imports to oslo-service
* Refactored tests to functional and unit packages
* Upgraded test requirement versions
* Added py34 test capability
* Upgraded hacking(pep8) version
* Added devstack plugin and settings to deploy Ceilosca
* Modified setup.cfg to use liberty entry points
* Refactored storage driver to compatible with v2 api liberty changes

Change-Id: Id6711e6661cde14df3decba6f56e52d391981f42
This commit is contained in:
Rohit Jaiswal 2015-11-11 01:35:04 +00:00
parent 3f823deee6
commit 865dab02b7
21 changed files with 366 additions and 375 deletions

View File

@ -18,11 +18,11 @@ import time
from oslo_config import cfg
from oslo_log import log
from oslo_service import loopingcall
import ceilometer
from ceilometer.i18n import _
from ceilometer import monasca_client as mon_client
from ceilometer.openstack.common import loopingcall
from ceilometer import publisher
from ceilometer.publisher.monasca_data_filter import MonascaDataFilter

View File

@ -20,6 +20,7 @@ import datetime
from monascaclient import exc as monasca_exc
from oslo_config import cfg
from oslo_log import log
from oslo_service import service as os_service
from oslo_utils import netutils
from oslo_utils import timeutils
@ -29,8 +30,6 @@ from eventlet.queue import Empty
import ceilometer
from ceilometer.i18n import _
from ceilometer import monasca_client
from ceilometer.openstack.common import threadgroup
from ceilometer.publisher.monasca_data_filter import MonascaDataFilter
from ceilometer.storage import base
from ceilometer.storage import models as api_models
@ -160,7 +159,7 @@ class Connection(base.Connection):
def get_resources(self, user=None, project=None, source=None,
start_timestamp=None, start_timestamp_op=None,
end_timestamp=None, end_timestamp_op=None,
metaquery=None, resource=None, pagination=None):
metaquery=None, resource=None, limit=None):
"""Return an iterable of dictionaries containing resource information.
{ 'resource_id': UUID of the resource,
@ -180,10 +179,11 @@ class Connection(base.Connection):
:param end_timestamp_op: Optional end time operator, like lt, le.
:param metaquery: Optional dict with metadata to match on.
:param resource: Optional resource filter.
:param pagination: Optional pagination query.
:param limit: Maximum number of results to return.
"""
if pagination:
raise ceilometer.NotImplementedError('Pagination not implemented')
if limit == 0:
return
# TODO(Implement limit correctly)
q = {}
if metaquery:
@ -249,7 +249,7 @@ class Connection(base.Connection):
pass
def get_meters(self, user=None, project=None, resource=None, source=None,
limit=None, metaquery=None, pagination=None):
metaquery=None, limit=None):
"""Return an iterable of dictionaries containing meter information.
{ 'name': name of the meter,
@ -263,12 +263,11 @@ class Connection(base.Connection):
:param project: Optional ID for project that owns the resource.
:param resource: Optional resource filter.
:param source: Optional source filter.
:param limit: Maximum number of results to return.
:param metaquery: Optional dict with metadata to match on.
:param pagination: Optional pagination query.
:param limit: Maximum number of results to return.
"""
if pagination:
raise ceilometer.NotImplementedError('Pagination not implemented')
if limit == 0:
return
if metaquery:
raise ceilometer.NotImplementedError('Metaquery not implemented')
@ -422,7 +421,7 @@ class Connection(base.Connection):
:param limit: Maximum number of results to return.
"""
# Initialize pool of green work threads and queue to handle results
thread_pool = threadgroup.ThreadGroup(
thread_pool = os_service.threadgroup.ThreadGroup(
thread_pool_size=cfg.CONF.monasca.query_concurrency_limit)
result_queue = eventlet.queue.Queue()

View File

@ -204,19 +204,6 @@ class TestListMeters(TestApi):
data = self.get_json('/meters')
self.assertEqual([], data)
def test_not_implemented(self):
resp = self.get_json('/meters',
q=[{'field': 'pagination',
'value': True}],
expect_errors=True)
expected_error_message = 'Pagination not implemented'
self.assertEqual(expected_error_message,
resp.json['error_message']['faultstring'])
self.assertEqual(501, resp.status_code)
def test_get_meters(self):
mnl_mock = self.mock_mon_client().metrics_list
@ -243,7 +230,8 @@ class TestListMeters(TestApi):
self.assertEqual(True, mnl_mock.called)
self.assertEqual(1, mnl_mock.call_count)
self.assertEqual(dict(dimensions=dict(resource_id=u'resource-1',
project_id=u'project-1')),
project_id=u'project-1'),
limit=100),
mnl_mock.call_args[1])
def test_get_meters_query_with_user(self):
@ -255,5 +243,6 @@ class TestListMeters(TestApi):
'value': 'user-1'}])
self.assertEqual(True, mnl_mock.called)
self.assertEqual(1, mnl_mock.call_count)
self.assertEqual(dict(dimensions=dict(user_id=u'user-1')),
self.assertEqual(dict(dimensions=dict(user_id=u'user-1'),
limit=100),
mnl_mock.call_args[1])

View File

@ -32,9 +32,6 @@ class TestGetResources(base.BaseTestCase):
with mock.patch("ceilometer.monasca_client.Client"):
conn = impl_monasca.Connection("127.0.0.1:8080")
kwargs = dict(pagination=True)
self.assertRaises(ceilometer.NotImplementedError,
lambda: list(conn.get_resources(**kwargs)))
kwargs = dict(start_timestamp_op='le')
self.assertRaises(ceilometer.NotImplementedError,
lambda: list(conn.get_resources(**kwargs)))
@ -111,10 +108,6 @@ class MeterTest(base.BaseTestCase):
with mock.patch('ceilometer.monasca_client.Client'):
conn = impl_monasca.Connection('127.0.0.1:8080')
kwargs = dict(pagination=True)
self.assertRaises(ceilometer.NotImplementedError,
lambda: list(conn.get_meters(**kwargs)))
kwargs = dict(metaquery=True)
self.assertRaises(ceilometer.NotImplementedError,
lambda: list(conn.get_meters(**kwargs)))
@ -636,7 +629,6 @@ class CapabilitiesTest(base.BaseTestCase):
expected_capabilities = {
'meters':
{
'pagination': False,
'query':
{
'complex': False,
@ -646,7 +638,6 @@ class CapabilitiesTest(base.BaseTestCase):
},
'resources':
{
'pagination': False,
'query':
{
'complex': False, 'metadata': True, 'simple': True
@ -679,7 +670,6 @@ class CapabilitiesTest(base.BaseTestCase):
},
'standard': True},
'groupby': False,
'pagination': False,
'query':
{
'complex': False,

View File

@ -2,15 +2,18 @@
export MONASCA_VAGRANT_REPO=https://git.openstack.org/openstack/monasca-vagrant
export DEVSTACK_REPO=https://git.openstack.org/openstack-dev/devstack.git
export CEILOMETER_REPO=https://git.openstack.org/openstack/ceilometer
export BASE_DIR=~
export WORK_DIR=$BASE_DIR/monasca-vagrant
export PREFERRED_BRANCH=stable/kilo
export PREFERRED_BRANCH=stable/liberty
export DEVSTACK_DIR=$BASE_DIR/devstack
export DEVSTACK_IP=192.168.10.5
export MINIMON_IP=192.168.10.4
export NETWORK_IF=eth0
export CEILOSCA_USER=$USER
export DEVSTACK_DEST=/opt/stack
export CEILOMETER_DEST=$DEVSTACK_DEST/ceilometer
#The following variables are used by, modified devstack ceilometer (deployer/devstack/ceilometer) script
export TARGET_IP=127.0.0.1
@ -24,11 +27,22 @@ clear_env()
unset OS_USERNAME OS_PASSWORD OS_PROJECT_NAME OS_AUTH_URL
}
download_ceilometer()
{
if [ ! -d $DEVSTACK_DEST ]; then
sudo mkdir -p $DEVSTACK_DEST
sudo chown $CEILOSCA_USER $DEVSTACK_DEST
fi
git clone -b $PREFERRED_BRANCH $CEILOMETER_REPO $CEILOMETER_DEST || true
cp deployer/devstack/settings $CEILOMETER_DEST/devstack
cp deployer/devstack/plugin.sh $CEILOMETER_DEST/devstack
}
setup_devstack()
{
git clone -b $PREFERRED_BRANCH $DEVSTACK_REPO $DEVSTACK_DIR || true
cp deployer/devstack/local.conf $DEVSTACK_DIR
cp deployer/devstack/ceilometer $DEVSTACK_DIR/lib
pushd $DEVSTACK_DIR
./unstack.sh || true
./stack.sh
@ -90,6 +104,7 @@ run_ceilosca()
}
clear_env
download_ceilometer
setup_devstack
install_ansible
get_monasca_files

View File

@ -19,8 +19,6 @@ SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
SWIFT_DATA_DIR=$DEST/data
enable_service ceilometer-acompute ceilometer-acentral ceilometer-anotification
enable_service ceilometer-alarm-evaluator ceilometer-alarm-notifier
enable_service ceilometer-api
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer stable/liberty
disable_service tempest

View File

@ -1,22 +1,16 @@
#!/bin/bash
# Install and start **Ceilometer** service in devstack
#
# lib/ceilometer
# Install and start **Ceilometer** service
# To enable a minimal set of Ceilometer services, add the following to the
# ``localrc`` section of ``local.conf``:
# To enable Ceilometer in devstack add an entry to local.conf that
# looks like
#
# enable_service ceilometer-acompute ceilometer-acentral ceilometer-anotification ceilometer-collector ceilometer-api
# [[local|localrc]]
# enable_plugin ceilometer git://git.openstack.org/openstack/ceilometer
#
# To ensure Ceilometer alarming services are enabled also, further add to the
# localrc section of local.conf:
# By default all ceilometer services are started (see
# devstack/settings). To disable a specific service use the
# disable_service function. For example to turn off alarming:
#
# enable_service ceilometer-alarm-notifier ceilometer-alarm-evaluator
#
# To enable Ceilometer to collect the IPMI based meters, further add to the
# localrc section of local.conf:
#
# enable_service ceilometer-aipmi
# disable_service ceilometer-alarm-notifier ceilometer-alarm-evaluator
#
# NOTE: Currently, there are two ways to get the IPMI based meters in
# OpenStack. One way is to configure Ironic conductor to report those meters
@ -25,7 +19,10 @@
# functionality. So in order to do so, users need to set the option of
# conductor.send_sensor_data to true in the ironic.conf configuration file
# for the Ironic conductor service, and also enable the
# ceilometer-anotification service.
# ceilometer-anotification service. If you do this disable the IPMI
# polling agent:
#
# disable_service ceilometer-aipmi
#
# The other way is to use Ceilometer ipmi agent only to get the IPMI based
# meters. To avoid duplicated meters, users need to make sure to set the
@ -36,73 +33,36 @@
# Several variables set in the localrc section adjust common behaviors
# of Ceilometer (see within for additional settings):
#
# CEILOMETER_USE_MOD_WSGI: When True, run the api under mod_wsgi.
# CEILOMETER_PIPELINE_INTERVAL: Seconds between pipeline processing runs. Default 600.
# CEILOMETER_BACKEND: Database backend (e.g. 'mysql', 'mongodb', 'es')
# CEILOMETER_COORDINATION_URL: URL for group membership service provided by tooz.
# CEILOMETER_EVENTS: Enable event collection
# Dependencies:
#
# - functions
# - OS_AUTH_URL for auth in api
# - DEST set to the destination directory
# - SERVICE_PASSWORD, SERVICE_TENANT_NAME for auth in api
# - STACK_USER service user
# stack.sh
# ---------
# - install_ceilometer
# - configure_ceilometer
# - init_ceilometer
# - start_ceilometer
# - stop_ceilometer
# - cleanup_ceilometer
# CEILOMETER_EVENTS: Set to True to enable event collection
# CEILOMETER_EVENT_ALARM: Set to True to enable publisher for event alarming
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
set -o xtrace
# Support potential entry-points console scripts in VENV or not
if [[ ${USE_VENV} = True ]]; then
PROJECT_VENV["ceilometer"]=${CEILOMETER_DIR}.venv
CEILOMETER_BIN_DIR=${PROJECT_VENV["ceilometer"]}/bin
else
CEILOMETER_BIN_DIR=$(get_python_exec_prefix)
fi
# Defaults
# --------
# Test if any Ceilometer services are enabled
# is_ceilometer_enabled
function is_ceilometer_enabled {
[[ ,${ENABLED_SERVICES} =~ ,"ceilometer-" ]] && return 0
return 1
}
# Set up default directories
GITDIR["python-ceilometerclient"]=$DEST/python-ceilometerclient
GITDIR["ceilometermiddleware"]=$DEST/ceilometermiddleware
function ceilometer_service_url {
echo "$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT"
}
CEILOMETER_DIR=$DEST/ceilometer
CEILOMETER_CONF_DIR=/etc/ceilometer
CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf
CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
CEILOMETER_AUTH_CACHE_DIR=${CEILOMETER_AUTH_CACHE_DIR:-/var/cache/ceilometer}
CEILOMETER_WSGI_DIR=${CEILOMETER_WSGI_DIR:-/var/www/ceilometer}
# Support potential entry-points console scripts
CEILOMETER_BIN_DIR=$(get_python_exec_prefix)
# Set up database backend
CEILOMETER_BACKEND=${CEILOMETER_BACKEND:-mysql}
# Ceilometer connection info.
CEILOMETER_SERVICE_PROTOCOL=http
CEILOMETER_SERVICE_HOST=$SERVICE_HOST
CEILOMETER_SERVICE_PORT=${CEILOMETER_SERVICE_PORT:-8777}
CEILOMETER_USE_MOD_WSGI=$(trueorfalse False CEILOMETER_USE_MOD_WSGI)
# To enable OSprofiler change value of this variable to "notifications,profiler"
CEILOMETER_NOTIFICATION_TOPICS=${CEILOMETER_NOTIFICATION_TOPICS:-notifications}
CEILOMETER_EVENTS=${CEILOMETER_EVENTS:-True}
CEILOMETER_COORDINATION_URL=${CEILOMETER_COORDINATION_URL:-}
CEILOMETER_PIPELINE_INTERVAL=${CEILOMETER_PIPELINE_INTERVAL:-}
# Tell Tempest this project is present
TEMPEST_SERVICES+=,ceilometer
# Functions
# ---------
function inject_ceilosca_goodness {
function inject_ceilosca_code {
#Assumes CEILOSCA_DIR is set
for ceilosca_file in $CEILOSCA_FILES
@ -114,48 +74,133 @@ function inject_ceilosca_goodness {
fi
done
if ! grep -q "python-monascaclient" $CEILOMETER_DIR/requirements.txt; then
sudo bash -c "echo python-monascaclient >> $CEILOMETER_DIR/requirements.txt"
fi
}
function inject_ceilosca_conf {
sudo mkdir -p /etc/ceilometer
sudo chown $CEILOSCA_USER /etc/ceilometer
for ceilosca_conf_file in $CEILOSCA_CONF_FILES
do
cp $CEILOSCA_DIR/etc/ceilometer/$ceilosca_conf_file /etc/ceilometer/$ceilosca_conf_file
done
}
if ! grep -q "python-monascaclient" $CEILOMETER_DIR/requirements.txt; then
sudo bash -c "echo python-monascaclient >> $CEILOMETER_DIR/requirements.txt"
# _ceilometer_install_mongdb - Install mongodb and python lib.
function _ceilometer_install_mongodb {
# Server package is the same on all
local packages=mongodb-server
if is_fedora; then
# mongodb client
packages="${packages} mongodb"
fi
install_package ${packages}
if is_fedora; then
restart_service mongod
else
restart_service mongodb
fi
# give time for service to restart
sleep 5
}
# _ceilometer_install_redis() - Install the redis server and python lib.
function _ceilometer_install_redis {
if is_ubuntu; then
install_package redis-server
restart_service redis-server
else
# This will fail (correctly) where a redis package is unavailable
install_package redis
restart_service redis
fi
pip_install_gr redis
}
# Configure mod_wsgi
function _ceilometer_config_apache_wsgi {
sudo mkdir -p $CEILOMETER_WSGI_DIR
local ceilometer_apache_conf=$(apache_site_config_for ceilometer)
local apache_version=$(get_apache_version)
local venv_path=""
# Copy proxy vhost and wsgi file
sudo cp $CEILOMETER_DIR/ceilometer/api/app.wsgi $CEILOMETER_WSGI_DIR/app
if [[ ${USE_VENV} = True ]]; then
venv_path="python-path=${PROJECT_VENV["ceilometer"]}/lib/$(python_version)/site-packages"
fi
sudo cp $CEILOMETER_DIR/devstack/apache-ceilometer.template $ceilometer_apache_conf
sudo sed -e "
s|%PORT%|$CEILOMETER_SERVICE_PORT|g;
s|%APACHE_NAME%|$APACHE_NAME|g;
s|%WSGIAPP%|$CEILOMETER_WSGI_DIR/app|g;
s|%USER%|$STACK_USER|g;
s|%VIRTUALENV%|$venv_path|g
" -i $ceilometer_apache_conf
}
# Install required services for coordination
function _ceilometer_prepare_coordination {
if echo $CEILOMETER_COORDINATION_URL | grep -q '^memcached:'; then
install_package memcached
elif echo $CEILOMETER_COORDINATION_URL | grep -q '^redis:'; then
_ceilometer_install_redis
fi
}
# Install required services for storage backends
function _ceilometer_prepare_storage_backend {
if [ "$CEILOMETER_BACKEND" = 'mongodb' ] ; then
pip_install_gr pymongo
_ceilometer_install_mongodb
fi
if [ "$CEILOMETER_BACKEND" = 'es' ] ; then
${TOP_DIR}/pkg/elasticsearch.sh download
${TOP_DIR}/pkg/elasticsearch.sh install
fi
}
# Install the python modules for inspecting nova virt instances
function _ceilometer_prepare_virt_drivers {
# Only install virt drivers if we're running nova compute
if is_service_enabled n-cpu ; then
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
pip_install_gr libvirt-python
fi
# Test if any Ceilometer services are enabled
# is_ceilometer_enabled
function is_ceilometer_enabled {
[[ ,${ENABLED_SERVICES} =~ ,"ceilometer-" ]] && return 0
return 1
if [[ "$VIRT_DRIVER" = 'vsphere' ]]; then
pip_install_gr oslo.vmware
fi
fi
}
# create_ceilometer_accounts() - Set up common required Ceilometer accounts
#
# Project User Roles
# ------------------------------------------------------------------
# SERVICE_TENANT_NAME ceilometer admin
# SERVICE_TENANT_NAME ceilometer ResellerAdmin (if Swift is enabled)
function create_ceilometer_accounts {
# Ceilometer
if [[ "$ENABLED_SERVICES" =~ "ceilometer-api" ]]; then
# Create ceilometer related accounts in Keystone
function _ceilometer_create_accounts {
if is_service_enabled ceilometer-api; then
create_service_user "ceilometer" "admin"
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
local ceilometer_service=$(get_or_create_service "ceilometer" \
"metering" "OpenStack Telemetry Service")
get_or_create_endpoint $ceilometer_service \
get_or_create_service "ceilometer" "metering" "OpenStack Telemetry Service"
get_or_create_endpoint "metering" \
"$REGION_NAME" \
"$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \
"$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \
"$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/"
"$(ceilometer_service_url)/" \
"$(ceilometer_service_url)/" \
"$(ceilometer_service_url)/"
fi
if is_service_enabled swift; then
# Ceilometer needs ResellerAdmin role to access Swift account stats.
@ -164,15 +209,19 @@ function create_ceilometer_accounts {
fi
}
# Activities to do before ceilometer has been installed.
function preinstall_ceilometer {
echo_summary "Preinstall not in virtualenv context. Skipping."
}
# _cleanup_keystone_apache_wsgi() - Remove WSGI files, disable and remove Apache vhost file
function _cleanup_ceilometer_apache_wsgi {
# Remove WSGI files, disable and remove Apache vhost file
function _ceilometer_cleanup_apache_wsgi {
sudo rm -f $CEILOMETER_WSGI_DIR/*
sudo rm -f $(apache_site_config_for ceilometer)
}
# cleanup_ceilometer() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
# cleanup_ceilometer() - Remove residual data files, anything left over
# from previous runs that a clean run would need to clean up
function cleanup_ceilometer {
if [ "$CEILOMETER_BACKEND" = 'mongodb' ] ; then
mongo ceilometer --eval "db.dropDatabase();"
@ -180,34 +229,41 @@ function cleanup_ceilometer {
curl -XDELETE "localhost:9200/events_*"
fi
if [ "$CEILOMETER_USE_MOD_WSGI" == "True" ]; then
_cleanup_ceilometer_apache_wsgi
_ceilometer_cleanup_apache_wsgi
fi
}
function _config_ceilometer_apache_wsgi {
sudo mkdir -p $CEILOMETER_WSGI_DIR
local ceilometer_apache_conf=$(apache_site_config_for ceilometer)
local apache_version=$(get_apache_version)
# Copy proxy vhost and wsgi file
sudo cp $CEILOMETER_DIR/ceilometer/api/app.wsgi $CEILOMETER_WSGI_DIR/app
sudo cp $FILES/apache-ceilometer.template $ceilometer_apache_conf
sudo sed -e "
s|%PORT%|$CEILOMETER_SERVICE_PORT|g;
s|%APACHE_NAME%|$APACHE_NAME|g;
s|%WSGIAPP%|$CEILOMETER_WSGI_DIR/app|g;
s|%USER%|$STACK_USER|g
" -i $ceilometer_apache_conf
# Set configuration for storage backend.
function _ceilometer_configure_storage_backend {
if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then
iniset $CEILOMETER_CONF database alarm_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF database event_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF database metering_connection monasca://$MONASCA_API_URL
#iniset $CEILOMETER_CONF database metering_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF DEFAULT collector_workers $API_WORKERS
elif [ "$CEILOMETER_BACKEND" = 'es' ] ; then
# es is only supported for events. we will use sql for alarming/metering.
iniset $CEILOMETER_CONF database alarm_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF database event_connection es://localhost:9200
iniset $CEILOMETER_CONF database metering_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF DEFAULT collector_workers $API_WORKERS
${TOP_DIR}/pkg/elasticsearch.sh start
cleanup_ceilometer
elif [ "$CEILOMETER_BACKEND" = 'mongodb' ] ; then
iniset $CEILOMETER_CONF database alarm_connection mongodb://localhost:27017/ceilometer
iniset $CEILOMETER_CONF database event_connection mongodb://localhost:27017/ceilometer
iniset $CEILOMETER_CONF database metering_connection mongodb://localhost:27017/ceilometer
cleanup_ceilometer
else
die $LINENO "Unable to configure unknown CEILOMETER_BACKEND $CEILOMETER_BACKEND"
fi
}
# configure_ceilometer() - Set config files, create data dirs, etc
# Configure Ceilometer
function configure_ceilometer {
sudo install -d -o $STACK_USER -m 755 $CEILOMETER_CONF_DIR $CEILOMETER_API_LOG_DIR
iniset_rpc_backend ceilometer $CEILOMETER_CONF
iniset $CEILOMETER_CONF DEFAULT notification_workers $API_WORKERS
iniset $CEILOMETER_CONF DEFAULT notification_topics "$CEILOMETER_NOTIFICATION_TOPICS"
iniset $CEILOMETER_CONF DEFAULT verbose True
iniset $CEILOMETER_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL"
@ -219,16 +275,23 @@ function configure_ceilometer {
# Install the policy file for the API server
cp $CEILOMETER_DIR/etc/ceilometer/policy.json $CEILOMETER_CONF_DIR
iniset $CEILOMETER_CONF DEFAULT policy_file $CEILOMETER_CONF_DIR/policy.json
iniset $CEILOMETER_CONF oslo_policy policy_file $CEILOMETER_CONF_DIR/policy.json
#cp $CEILOMETER_DIR/etc/ceilometer/pipeline.yaml $CEILOMETER_CONF_DIR
cp $CEILOMETER_DIR/etc/ceilometer/pipeline.yaml $CEILOMETER_CONF_DIR
cp $CEILOMETER_DIR/etc/ceilometer/event_pipeline.yaml $CEILOMETER_CONF_DIR
cp $CEILOMETER_DIR/etc/ceilometer/api_paste.ini $CEILOMETER_CONF_DIR
cp $CEILOMETER_DIR/etc/ceilometer/event_definitions.yaml $CEILOMETER_CONF_DIR
cp $CEILOMETER_DIR/etc/ceilometer/gnocchi_archive_policy_map.yaml $CEILOMETER_CONF_DIR
cp $CEILOMETER_DIR/etc/ceilometer/gnocchi_resources.yaml $CEILOMETER_CONF_DIR
if [ "$CEILOMETER_PIPELINE_INTERVAL" ]; then
sed -i "s/interval:.*/interval: ${CEILOMETER_PIPELINE_INTERVAL}/" $CEILOMETER_CONF_DIR/pipeline.yaml
fi
if [ "$CEILOMETER_EVENT_ALARM" == "True" ]; then
if ! grep -q '^ *- notifier://?topic=alarm.all$' $CEILOMETER_CONF_DIR/event_pipeline.yaml; then
sed -i '/^ *publishers:$/,+1s|^\( *\)-.*$|\1- notifier://?topic=alarm.all\n&|' $CEILOMETER_CONF_DIR/event_pipeline.yaml
fi
fi
# The compute and central agents need these credentials in order to
# call out to other services' public APIs.
@ -243,27 +306,10 @@ function configure_ceilometer {
iniset $CEILOMETER_CONF notification store_events $CEILOMETER_EVENTS
if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then
iniset $CEILOMETER_CONF database alarm_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF database event_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF database metering_connection monasca://$MONASCA_API_URL
#iniset $CEILOMETER_CONF database metering_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF DEFAULT collector_workers $API_WORKERS
elif [ "$CEILOMETER_BACKEND" = 'es' ] ; then
# es is only supported for events. we will use sql for alarming/metering.
iniset $CEILOMETER_CONF database alarm_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF database event_connection es://localhost:9200
iniset $CEILOMETER_CONF database metering_connection $(database_connection_url ceilometer)
iniset $CEILOMETER_CONF DEFAULT collector_workers $API_WORKERS
${TOP_DIR}/pkg/elasticsearch.sh start
cleanup_ceilometer
else
iniset $CEILOMETER_CONF database alarm_connection mongodb://localhost:27017/ceilometer
iniset $CEILOMETER_CONF database event_connection mongodb://localhost:27017/ceilometer
iniset $CEILOMETER_CONF database metering_connection mongodb://localhost:27017/ceilometer
configure_mongodb
cleanup_ceilometer
fi
inject_ceilosca_conf
# Configure storage
_ceilometer_configure_storage_backend
if [[ "$VIRT_DRIVER" = 'vsphere' ]]; then
iniset $CEILOMETER_CONF DEFAULT hypervisor_inspector vsphere
@ -272,43 +318,23 @@ function configure_ceilometer {
iniset $CEILOMETER_CONF vmware host_password "$VMWAREAPI_PASSWORD"
fi
# NOTE: This must come after database configurate as those can
# call cleanup_ceilometer which will wipe the WSGI config.
if [ "$CEILOMETER_USE_MOD_WSGI" == "True" ]; then
iniset $CEILOMETER_CONF api pecan_debug "False"
_config_ceilometer_apache_wsgi
_ceilometer_config_apache_wsgi
fi
if is_service_enabled ceilometer-aipmi; then
# Configure rootwrap for the ipmi agent
configure_rootwrap ceilometer $CEILOMETER_BIN_DIR/ceilometer-rootwrap $CEILOMETER_DIR/etc/ceilometer
configure_rootwrap ceilometer
fi
}
function configure_mongodb {
# Server package is the same on all
local packages=mongodb-server
if is_fedora; then
# mongodb client + python bindings
packages="${packages} mongodb pymongo"
else
packages="${packages} python-pymongo"
fi
install_package ${packages}
if is_fedora; then
# Ensure smallfiles is selected to minimize freespace requirements
sudo sed -i '/--smallfiles/!s/OPTIONS=\"/OPTIONS=\"--smallfiles /' /etc/sysconfig/mongod
restart_service mongod
fi
# Give mongodb time to start-up
sleep 5
}
# init_ceilometer() - Initialize etc.
function init_ceilometer {
# Get ceilometer keystone settings in place
_ceilometer_create_accounts
# Create cache dir
sudo install -d -o $STACK_USER $CEILOMETER_AUTH_CACHE_DIR
rm -f $CEILOMETER_AUTH_CACHE_DIR/*
@ -321,37 +347,21 @@ function init_ceilometer {
fi
}
# install_redis() - Install the redis server.
function install_redis {
if is_ubuntu; then
install_package redis-server
restart_service redis-server
else
# This will fail (correctly) where a redis package is unavailable
install_package redis
restart_service redis
fi
}
# install_ceilometer() - Collect source and prepare
# Install Ceilometer.
# The storage and coordination backends are installed here because the
# virtualenv context is active at this point and python drivers need to be
# installed. The context is not active during preinstall (when it would
# otherwise makes sense to do the backend services).
function install_ceilometer {
git_clone $CEILOMETER_REPO $CEILOMETER_DIR $CEILOMETER_BRANCH
inject_ceilosca_goodness
inject_ceilosca_code
_ceilometer_prepare_coordination
_ceilometer_prepare_storage_backend
_ceilometer_prepare_virt_drivers
install_ceilometerclient
setup_develop $CEILOMETER_DIR
if echo $CEILOMETER_COORDINATION_URL | grep -q '^memcached:'; then
install_package memcached
elif echo $CEILOMETER_COORDINATION_URL | grep -q '^redis:'; then
install_redis
fi
if [ "$CEILOMETER_BACKEND" = 'es' ] ; then
${TOP_DIR}/pkg/elasticsearch.sh download
${TOP_DIR}/pkg/elasticsearch.sh install
fi
sudo install -d -o $STACK_USER -m 755 $CEILOMETER_CONF_DIR $CEILOMETER_API_LOG_DIR
}
# install_ceilometerclient() - Collect source and prepare
@ -360,31 +370,19 @@ function install_ceilometerclient {
git_clone_by_name "python-ceilometerclient"
setup_dev_lib "python-ceilometerclient"
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ceilometerclient"]}/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
fi
}
# install_ceilometermiddleware() - Collect source and prepare
function install_ceilometermiddleware {
if use_library_from_git "ceilometermiddleware"; then
git_clone_by_name "ceilometermiddleware"
setup_dev_lib "ceilometermiddleware"
else
# BUG: this should be a pip_install_gr except it was never
# included in global-requirements. Needs to be fixed by
# https://bugs.launchpad.net/ceilometer/+bug/1441655
pip_install ceilometermiddleware
pip_install_gr python-ceilometerclient
fi
}
# start_ceilometer() - Start running processes, including screen
function start_ceilometer {
run_process ceilometer-acentral "ceilometer-agent-central --config-file $CEILOMETER_CONF"
run_process ceilometer-anotification "ceilometer-agent-notification --config-file $CEILOMETER_CONF"
run_process ceilometer-collector "ceilometer-collector --config-file $CEILOMETER_CONF"
run_process ceilometer-aipmi "ceilometer-agent-ipmi --config-file $CEILOMETER_CONF"
run_process ceilometer-acentral "$CEILOMETER_BIN_DIR/ceilometer-polling --polling-namespaces central --config-file $CEILOMETER_CONF"
run_process ceilometer-anotification "$CEILOMETER_BIN_DIR/ceilometer-agent-notification --config-file $CEILOMETER_CONF"
run_process ceilometer-aipmi "$CEILOMETER_BIN_DIR/ceilometer-polling --polling-namespaces ipmi --config-file $CEILOMETER_CONF"
if [[ "$CEILOMETER_USE_MOD_WSGI" == "False" ]]; then
run_process ceilometer-api "ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF"
run_process ceilometer-api "$CEILOMETER_BIN_DIR/ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF"
else
enable_apache_site ceilometer
restart_apache_server
@ -392,26 +390,29 @@ function start_ceilometer {
tail_log ceilometer-api /var/log/$APACHE_NAME/ceilometer_access.log
fi
# run the the collector after restarting apache as it needs
# operational keystone if using gnocchi
run_process ceilometer-collector "$CEILOMETER_BIN_DIR/ceilometer-collector --config-file $CEILOMETER_CONF"
# Start the compute agent last to allow time for the collector to
# Start the compute agent late to allow time for the collector to
# fully wake up and connect to the message bus. See bug #1355809
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
run_process ceilometer-acompute "ceilometer-agent-compute --config-file $CEILOMETER_CONF" $LIBVIRT_GROUP
run_process ceilometer-acompute "$CEILOMETER_BIN_DIR/ceilometer-polling --polling-namespaces compute --config-file $CEILOMETER_CONF" $LIBVIRT_GROUP
fi
if [[ "$VIRT_DRIVER" = 'vsphere' ]]; then
run_process ceilometer-acompute "ceilometer-agent-compute --config-file $CEILOMETER_CONF"
run_process ceilometer-acompute "$CEILOMETER_BIN_DIR/ceilometer-polling --polling-namespaces compute --config-file $CEILOMETER_CONF"
fi
# Only die on API if it was actually intended to be turned on
if is_service_enabled ceilometer-api; then
echo "Waiting for ceilometer-api to start..."
if ! wait_for_service $SERVICE_TIMEOUT $CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/v2/; then
if ! wait_for_service $SERVICE_TIMEOUT $(ceilometer_service_url)/v2/; then
die $LINENO "ceilometer-api did not start"
fi
fi
run_process ceilometer-alarm-notifier "ceilometer-alarm-notifier --config-file $CEILOMETER_CONF"
run_process ceilometer-alarm-evaluator "ceilometer-alarm-evaluator --config-file $CEILOMETER_CONF"
run_process ceilometer-alarm-notifier "$CEILOMETER_BIN_DIR/ceilometer-alarm-notifier --config-file $CEILOMETER_CONF"
run_process ceilometer-alarm-evaluator "$CEILOMETER_BIN_DIR/ceilometer-alarm-evaluator --config-file $CEILOMETER_CONF"
}
# stop_ceilometer() - Stop running processes
@ -426,11 +427,37 @@ function stop_ceilometer {
done
}
# This is the main for plugin.sh
if is_service_enabled ceilometer; then
if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
# Set up other services
echo_summary "Configuring system services for Ceilometer"
preinstall_ceilometer
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing Ceilometer"
# Use stack_install_service here to account for vitualenv
stack_install_service ceilometer
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring Ceilometer"
configure_ceilometer
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
echo_summary "Initializing Ceilometer"
# Tidy base for ceilometer
init_ceilometer
# Start the services
start_ceilometer
fi
if [[ "$1" == "unstack" ]]; then
echo_summary "Shutting Down Ceilometer"
stop_ceilometer
fi
if [[ "$1" == "clean" ]]; then
echo_summary "Cleaning Ceilometer"
cleanup_ceilometer
fi
fi
# Restore xtrace
$XTRACE
# Tell emacs to use shell-script-mode
## Local variables:
## mode: shell-script
## End:
$XTRACE

View File

@ -0,0 +1,50 @@
# turn on following ceilometer services by default
# Pollsters
enable_service ceilometer-acompute ceilometer-acentral
# Notification Agent
enable_service ceilometer-anotification
# API service
enable_service ceilometer-api
# Alarming
enable_service ceilometer-alarm-notifier ceilometer-alarm-evaluator
# Default directories
CEILOMETER_DIR=$DEST/ceilometer
CEILOMETER_CONF_DIR=/etc/ceilometer
CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf
CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
CEILOMETER_AUTH_CACHE_DIR=${CEILOMETER_AUTH_CACHE_DIR:-/var/cache/ceilometer}
CEILOMETER_WSGI_DIR=${CEILOMETER_WSGI_DIR:-/var/www/ceilometer}
# Set up database backend
CEILOMETER_BACKEND=${CEILOMETER_BACKEND:-mysql}
# Ceilometer connection info.
CEILOMETER_SERVICE_PROTOCOL=http
CEILOMETER_SERVICE_HOST=$SERVICE_HOST
CEILOMETER_SERVICE_PORT=${CEILOMETER_SERVICE_PORT:-8777}
CEILOMETER_USE_MOD_WSGI=${CEILOMETER_USE_MOD_WSGI:-${ENABLE_HTTPD_MOD_WSGI_SERVICES}}
# To enable OSprofiler change value of this variable to "notifications,profiler"
CEILOMETER_NOTIFICATION_TOPICS=${CEILOMETER_NOTIFICATION_TOPICS:-notifications}
CEILOMETER_EVENTS=${CEILOMETER_EVENTS:-True}
CEILOMETER_COORDINATION_URL=${CEILOMETER_COORDINATION_URL:-}
CEILOMETER_PIPELINE_INTERVAL=${CEILOMETER_PIPELINE_INTERVAL:-}
CEILOMETER_EVENT_ALARM=${CEILOMETER_EVENT_ALARM:-False}
# Tell Tempest this project is present
TEMPEST_SERVICES+=,ceilometer
# Set up default directories for client and middleware
GITREPO["python-ceilometerclient"]=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git}
GITBRANCH["python-ceilometerclient"]=${CEILOMETERCLIENT_BRANCH:-master}
GITDIR["python-ceilometerclient"]=$DEST/python-ceilometerclient
GITDIR["ceilometermiddleware"]=$DEST/ceilometermiddleware
# Get rid of this before done.
# Tell emacs to use shell-script-mode
## Local variables:
## mode: shell-script
## End:

View File

@ -1 +1 @@
hacking>=0.9.2,<0.10
hacking<0.11,>=0.10.0

109
setup.cfg
View File

@ -1,6 +1,5 @@
[metadata]
name = ceilometer
version = 2015.1.3
summary = OpenStack Telemetry
description-file =
README.rst
@ -28,55 +27,15 @@ packages =
[entry_points]
ceilometer.notification =
magnetodb_table = ceilometer.key_value_storage.notifications:Table
magnetodb_index_count = ceilometer.key_value_storage.notifications:Index
instance = ceilometer.compute.notifications.instance:Instance
instance_flavor = ceilometer.compute.notifications.instance:InstanceFlavor
instance_delete = ceilometer.compute.notifications.instance:InstanceDelete
instance_scheduled = ceilometer.compute.notifications.instance:InstanceScheduled
memory = ceilometer.compute.notifications.instance:Memory
vcpus = ceilometer.compute.notifications.instance:VCpus
disk_root_size = ceilometer.compute.notifications.instance:RootDiskSize
disk_ephemeral_size = ceilometer.compute.notifications.instance:EphemeralDiskSize
cpu_frequency = ceilometer.compute.notifications.cpu:CpuFrequency
cpu_user_time = ceilometer.compute.notifications.cpu:CpuUserTime
cpu_kernel_time = ceilometer.compute.notifications.cpu:CpuKernelTime
cpu_idle_time = ceilometer.compute.notifications.cpu:CpuIdleTime
cpu_iowait_time = ceilometer.compute.notifications.cpu:CpuIowaitTime
cpu_kernel_percent = ceilometer.compute.notifications.cpu:CpuKernelPercent
cpu_idle_percent = ceilometer.compute.notifications.cpu:CpuIdlePercent
cpu_user_percent = ceilometer.compute.notifications.cpu:CpuUserPercent
cpu_iowait_percent = ceilometer.compute.notifications.cpu:CpuIowaitPercent
cpu_percent = ceilometer.compute.notifications.cpu:CpuPercent
volume = ceilometer.volume.notifications:Volume
volume_size = ceilometer.volume.notifications:VolumeSize
volume_crud = ceilometer.volume.notifications:VolumeCRUD
snapshot = ceilometer.volume.notifications:Snapshot
snapshot_size = ceilometer.volume.notifications:SnapshotSize
snapshot_crud = ceilometer.volume.notifications:SnapshotCRUD
authenticate = ceilometer.identity.notifications:Authenticate
user = ceilometer.identity.notifications:User
group = ceilometer.identity.notifications:Group
role = ceilometer.identity.notifications:Role
project = ceilometer.identity.notifications:Project
trust = ceilometer.identity.notifications:Trust
role_assignment = ceilometer.identity.notifications:RoleAssignment
image_crud = ceilometer.image.notifications:ImageCRUD
image = ceilometer.image.notifications:Image
image_size = ceilometer.image.notifications:ImageSize
image_download = ceilometer.image.notifications:ImageDownload
image_serve = ceilometer.image.notifications:ImageServe
network = ceilometer.network.notifications:Network
subnet = ceilometer.network.notifications:Subnet
port = ceilometer.network.notifications:Port
router = ceilometer.network.notifications:Router
floatingip = ceilometer.network.notifications:FloatingIP
bandwidth = ceilometer.network.notifications:Bandwidth
http.request = ceilometer.middleware:HTTPRequest
http.response = ceilometer.middleware:HTTPResponse
stack_crud = ceilometer.orchestration.notifications:StackCRUD
data_processing = ceilometer.data_processing.notifications:DataProcessing
profiler = ceilometer.profiler.notifications:ProfilerNotifications
hardware.ipmi.temperature = ceilometer.ipmi.notifications.ironic:TemperatureSensorNotification
hardware.ipmi.voltage = ceilometer.ipmi.notifications.ironic:VoltageSensorNotification
hardware.ipmi.current = ceilometer.ipmi.notifications.ironic:CurrentSensorNotification
@ -92,8 +51,10 @@ ceilometer.notification =
network.services.vpn.ipsecpolicy = ceilometer.network.notifications:IPSecPolicy
network.services.vpn.ikepolicy = ceilometer.network.notifications:IKEPolicy
network.services.vpn.connections = ceilometer.network.notifications:IPSecSiteConnection
objectstore.request = ceilometer.objectstore.notifications:SwiftWsgiMiddleware
objectstore.request.meters = ceilometer.objectstore.notifications:SwiftWsgiMiddlewareMeters
_sample = ceilometer.telemetry.notifications:TelemetryIpc
trove.instance.exists = ceilometer.database.notifications:InstanceExists
dns.domain.exists = ceilometer.dns.notifications:DomainExists
meter = ceilometer.meter.notifications:ProcessMeterNotifications
ceilometer.discover =
local_instances = ceilometer.compute.discovery:InstanceDiscovery
@ -140,7 +101,6 @@ ceilometer.poll.compute =
network.incoming.bytes.rate = ceilometer.compute.pollsters.net:IncomingBytesRatePollster
network.outgoing.bytes.rate = ceilometer.compute.pollsters.net:OutgoingBytesRatePollster
instance = ceilometer.compute.pollsters.instance:InstancePollster
instance_flavor = ceilometer.compute.pollsters.instance:InstanceFlavorPollster
memory.usage = ceilometer.compute.pollsters.memory:MemoryUsagePollster
memory.resident = ceilometer.compute.pollsters.memory:MemoryResidentPollster
disk.capacity = ceilometer.compute.pollsters.disk:CapacityPollster
@ -204,23 +164,6 @@ ceilometer.poll.central =
switch.flow.duration.nanoseconds = ceilometer.network.statistics.flow:FlowPollsterDurationNanoseconds
switch.flow.duration.seconds = ceilometer.network.statistics.flow:FlowPollsterDurationSeconds
switch.flow.packets = ceilometer.network.statistics.flow:FlowPollsterPackets
hardware.cpu.load.1min = ceilometer.hardware.pollsters.cpu:CPULoad1MinPollster
hardware.cpu.load.5min = ceilometer.hardware.pollsters.cpu:CPULoad5MinPollster
hardware.cpu.load.15min = ceilometer.hardware.pollsters.cpu:CPULoad15MinPollster
hardware.disk.size.total = ceilometer.hardware.pollsters.disk:DiskTotalPollster
hardware.disk.size.used = ceilometer.hardware.pollsters.disk:DiskUsedPollster
hardware.network.incoming.bytes = ceilometer.hardware.pollsters.net:IncomingBytesPollster
hardware.network.outgoing.bytes = ceilometer.hardware.pollsters.net:OutgoingBytesPollster
hardware.network.outgoing.errors = ceilometer.hardware.pollsters.net:OutgoingErrorsPollster
hardware.memory.total = ceilometer.hardware.pollsters.memory:MemoryTotalPollster
hardware.memory.used = ceilometer.hardware.pollsters.memory:MemoryUsedPollster
hardware.memory.swap.total = ceilometer.hardware.pollsters.memory:MemorySwapTotalPollster
hardware.memory.swap.avail = ceilometer.hardware.pollsters.memory:MemorySwapAvailPollster
hardware.system_stats.cpu.idle = ceilometer.hardware.pollsters.system:SystemCpuIdlePollster
hardware.system_stats.io.outgoing.blocks = ceilometer.hardware.pollsters.system:SystemIORawSentPollster
hardware.system_stats.io.incoming.blocks = ceilometer.hardware.pollsters.system:SystemIORawReceivedPollster
hardware.network.ip.outgoing.datagrams = ceilometer.hardware.pollsters.network_aggregated:NetworkAggregatedIPOutRequests
hardware.network.ip.incoming.datagrams = ceilometer.hardware.pollsters.network_aggregated:NetworkAggregatedIPInReceives
network.services.lb.pool = ceilometer.network.services.lbaas:LBPoolPollster
network.services.lb.vip = ceilometer.network.services.lbaas:LBVipPollster
network.services.lb.member = ceilometer.network.services.lbaas:LBMemberPollster
@ -234,6 +177,9 @@ ceilometer.poll.central =
network.services.firewall = ceilometer.network.services.fwaas:FirewallPollster
network.services.firewall.policy = ceilometer.network.services.fwaas:FirewallPolicyPollster
ceilometer.builder.poll.central =
hardware.snmp = ceilometer.hardware.pollsters.generic:GenericHardwareDeclarativePollster
ceilometer.alarm.storage =
log = ceilometer.alarm.storage.impl_log:Connection
mongodb = ceilometer.alarm.storage.impl_mongodb:Connection
@ -274,6 +220,7 @@ ceilometer.hardware.inspectors =
ceilometer.transformer =
accumulator = ceilometer.transformer.accumulator:TransformerAccumulator
delta = ceilometer.transformer.conversions:DeltaTransformer
unit_conversion = ceilometer.transformer.conversions:ScalingTransformer
rate_of_change = ceilometer.transformer.conversions:RateOfChangeTransformer
aggregator = ceilometer.transformer.conversions:AggregatorTransformer
@ -311,14 +258,6 @@ ceilometer.alarm.evaluator =
gnocchi_aggregation_by_metrics_threshold = ceilometer.alarm.evaluator.gnocchi:GnocchiThresholdEvaluator
gnocchi_aggregation_by_resources_threshold = ceilometer.alarm.evaluator.gnocchi:GnocchiThresholdEvaluator
ceilometer.alarm.evaluator_service =
default = ceilometer.alarm.service:AlarmEvaluationService
singleton = ceilometer.alarm.service:SingletonAlarmService
partitioned = ceilometer.alarm.service:PartitionedAlarmService
# NOTE(sileht): for backward compatibility
ceilometer.alarm.service.SingletonAlarmService = ceilometer.alarm.service:SingletonAlarmService
ceilometer.alarm.service.PartitionedAlarmService = ceilometer.alarm.service:PartitionedAlarmService
ceilometer.alarm.notifier =
log = ceilometer.alarm.notifier.log:LogAlarmNotifier
test = ceilometer.alarm.notifier.test:TestAlarmNotifier
@ -331,41 +270,28 @@ ceilometer.event.trait_plugin =
split = ceilometer.event.trait_plugins:SplitterTraitPlugin
bitfield = ceilometer.event.trait_plugins:BitfieldTraitPlugin
paste.filter_factory =
swift = ceilometer.objectstore.swift_middleware:filter_factory
console_scripts =
ceilometer-api = ceilometer.cmd.api:main
ceilometer-agent-central = ceilometer.cmd.polling:main_central
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.polling:main_ipmi
ceilometer-send-sample = ceilometer.cli:send_sample
ceilometer-dbsync = ceilometer.cmd.storage:dbsync
ceilometer-expirer = ceilometer.cmd.storage:expirer
ceilometer-polling = ceilometer.cmd.eventlet.polling:main
ceilometer-agent-notification = ceilometer.cmd.eventlet.agent_notification:main
ceilometer-send-sample = ceilometer.cmd.eventlet.sample:send_sample
ceilometer-dbsync = ceilometer.cmd.eventlet.storage:dbsync
ceilometer-expirer = ceilometer.cmd.eventlet.storage:expirer
ceilometer-rootwrap = oslo_rootwrap.cmd:main
ceilometer-collector = ceilometer.cmd.collector:main
ceilometer-alarm-evaluator = ceilometer.cmd.alarm:evaluator
ceilometer-alarm-notifier = ceilometer.cmd.alarm:notifier
ceilometer-collector = ceilometer.cmd.eventlet.collector:main
ceilometer-alarm-evaluator = ceilometer.cmd.eventlet.alarm:evaluator
ceilometer-alarm-notifier = ceilometer.cmd.eventlet.alarm:notifier
ceilometer.dispatcher =
database = ceilometer.dispatcher.database:DatabaseDispatcher
file = ceilometer.dispatcher.file:FileDispatcher
http = ceilometer.dispatcher.http:HttpDispatcher
gnocchi = ceilometer.dispatcher.gnocchi:GnocchiDispatcher
network.statistics.drivers =
opendaylight = ceilometer.network.statistics.opendaylight.driver:OpenDayLightDriver
opencontrail = ceilometer.network.statistics.opencontrail.driver:OpencontrailDriver
# These are for backwards compat with Havana notification_driver configuration values
oslo.messaging.notify.drivers =
ceilometer.openstack.common.notifier.log_notifier = oslo.messaging.notify._impl_log:LogDriver
ceilometer.openstack.common.notifier.no_op_notifier = oslo.messaging.notify._impl_noop:NoOpDriver
ceilometer.openstack.common.notifier.rpc_notifier2 = oslo.messaging.notify._impl_messaging:MessagingV2Driver
ceilometer.openstack.common.notifier.rpc_notifier = oslo.messaging.notify._impl_messaging:MessagingDriver
ceilometer.openstack.common.notifier.test_notifier = oslo.messaging.notify._impl_test:TestDriver
oslo.config.opts =
ceilometer = ceilometer.opts:list_opts
@ -376,6 +302,7 @@ source-dir = doc/source
[pbr]
warnerrors = true
autodoc_index_modules = true
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext

View File

@ -1,15 +1,15 @@
hacking>=0.9.2,<0.10
git+https://github.com/openstack/ceilometer.git@stable/kilo#egg=ceilometer
mock>=1.0
hacking<0.11,>=0.10.0
git+https://github.com/openstack/ceilometer.git@stable/liberty#egg=ceilometer
mock>=1.2
testrepository>=0.0.18
testscenarios>=0.4
testtools>=1.4.0
oslosphinx>=2.5.0 # Apache-2.0
oslotest>=1.5.1 # Apache-2.0
oslo.vmware>=0.13.1 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
oslo.vmware>=1.16.0 # Apache-2.0
# Use lower versions of config and utils since
# Keystone client depends on it
oslo.config>=1.9.3,<1.10.0 # Apache-2.0
oslo.utils>=1.4.0,<1.5.0
oslo.log
oslo.config>=2.3.0 # Apache-2.0
oslo.utils!=2.6.0,>=2.0.0 # Apache-2.0
oslo.log>=1.8.0 # Apache-2.0
python-monascaclient

12
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
envlist = pep8,py27
envlist = pep8,py27,py34
minversion = 1.6
skipsdist = True
@ -21,15 +21,11 @@ commands = flake8
downloadcache = ~/cache/pip
[flake8]
ignore =
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
show-source = True
# H302 Do not import objects, only modules
# H305 imports not grouped correctly
# H307 like imports should be grouped together
# H904 Wrap long lines in parentheses instead of a backslash
ignore = H302,H305,H307,H904
builtins = _
exclude=.venv,.git,.tox,dist,client_api_example.py,*openstack/common*,*lib/python*,*egg,build,.ropeproject
[hacking]
import_exceptions =
ceilometer.i18n