Add bin/ceilometer-api for convenience

This is a bit more obvious than running the module.
I have basically just moved api/__main__.py into bin/ceilometer-api.

Change-Id: I50d614ea98b278563b576e0b3b9df03b391e2152
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
Angus Salkeld 2012-09-03 13:51:12 +10:00
parent 4b8a56f89a
commit 731d3fce5e
4 changed files with 11 additions and 7 deletions

10
ceilometer/api/__main__.py → bin/ceilometer-api Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
# #
# Copyright © 2012 New Dream Network, LLC (DreamHost) # Copyright © 2012 New Dream Network, LLC (DreamHost)
@ -17,11 +18,16 @@
# under the License. # under the License.
"""Set up the development API server. """Set up the development API server.
""" """
import sys
from ceilometer.api.app import app from ceilometer.api.app import app
from ceilometer.openstack.common import cfg from ceilometer.openstack.common import cfg
from ceilometer.openstack.common import log as logging
if __name__ == '__main__': if __name__ == '__main__':
cfg.CONF() cfg.CONF(sys.argv[1:])
app.debug = True 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) app.run(host='0.0.0.0', port=cfg.CONF.metering_api_port)

View File

@ -61,15 +61,12 @@ ceilometer::
Running the API Server Running the API Server
====================== ======================
There is not currently a wrapper script for the ceilometer API server,
so it must be started manually.
.. index:: .. index::
double: installing; API double: installing; API
:: ::
$ python -m ceilometer.api $ ceilometer-api
.. note:: .. note::

View File

@ -34,6 +34,7 @@ setuptools.setup(
setup_requires=['setuptools-git>=0.4'], setup_requires=['setuptools-git>=0.4'],
scripts=['bin/ceilometer-agent-compute', scripts=['bin/ceilometer-agent-compute',
'bin/ceilometer-agent-central', 'bin/ceilometer-agent-central',
'bin/ceilometer-api',
'bin/ceilometer-collector'], 'bin/ceilometer-collector'],
py_modules=[], py_modules=[],
entry_points=textwrap.dedent(""" entry_points=textwrap.dedent("""

View File

@ -18,7 +18,7 @@ commands = {toxinidir}/run_tests.sh --no-path-adjustment --with-coverage --cover
[testenv:pep8] [testenv:pep8]
deps = pep8==1.1 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] [testenv:py26-essex]
deps = -r{toxinidir}/tools/pip-requires_essex deps = -r{toxinidir}/tools/pip-requires_essex