diff --git a/ceilometer/api/__main__.py b/bin/ceilometer-api old mode 100644 new mode 100755 similarity index 80% rename from ceilometer/api/__main__.py rename to bin/ceilometer-api index cc0ea04f20..fadd9744fb --- a/ceilometer/api/__main__.py +++ b/bin/ceilometer-api @@ -1,3 +1,4 @@ +#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) @@ -17,11 +18,16 @@ # under the License. """Set up the development API server. """ +import sys from ceilometer.api.app import app from ceilometer.openstack.common import cfg +from ceilometer.openstack.common import log as logging + if __name__ == '__main__': - cfg.CONF() - app.debug = True + cfg.CONF(sys.argv[1:]) + logging.setup('ceilometer.api') + if cfg.CONF.verbose or cfg.CONF.debug: + app.debug = True app.run(host='0.0.0.0', port=cfg.CONF.metering_api_port) diff --git a/doc/source/install.rst b/doc/source/install.rst index de90dfa6f4..2ab28d6079 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -61,15 +61,12 @@ ceilometer:: Running the API Server ====================== -There is not currently a wrapper script for the ceilometer API server, -so it must be started manually. - .. index:: double: installing; API :: - $ python -m ceilometer.api + $ ceilometer-api .. note:: diff --git a/setup.py b/setup.py index b50aa235cf..b4ff50e6e6 100755 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ setuptools.setup( setup_requires=['setuptools-git>=0.4'], scripts=['bin/ceilometer-agent-compute', 'bin/ceilometer-agent-central', + 'bin/ceilometer-api', 'bin/ceilometer-collector'], py_modules=[], entry_points=textwrap.dedent(""" diff --git a/tox.ini b/tox.ini index 6ce51bab86..8999960bf9 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ commands = {toxinidir}/run_tests.sh --no-path-adjustment --with-coverage --cover [testenv:pep8] deps = pep8==1.1 -commands = pep8 --repeat --show-source ceilometer setup.py bin/ceilometer-agent-central bin/ceilometer-agent-compute bin/ceilometer-collector +commands = pep8 --repeat --show-source ceilometer setup.py bin/ceilometer-agent-central bin/ceilometer-agent-compute bin/ceilometer-collector bin/ceilometer-api [testenv:py26-essex] deps = -r{toxinidir}/tools/pip-requires_essex