1 Description: Removes the need for WSME
2 Author: Julien Danjou <julien@danjou.info>
3 Origin: upstream, https://review.openstack.org/#/c/18477/
5 --- ceilometer-2013.1~g0.4+23ff2f9bbf.orig/bin/ceilometer-api
6 +++ ceilometer-2013.1~g0.4+23ff2f9bbf/bin/ceilometer-api
9 """Set up the development API server.
13 -from wsgiref import simple_server
15 -from pecan import configuration
17 -from ceilometer.api import acl
18 -from ceilometer.api import app
19 -from ceilometer.api import config as api_config
20 +from ceilometer.api.v1 import acl
21 +from ceilometer.api.v1 import app
22 from ceilometer.openstack.common import cfg
23 from ceilometer.openstack.common import log as logging
25 @@ -37,34 +32,15 @@ if __name__ == '__main__':
27 acl.register_opts(cfg.CONF)
29 - # Parse OpenStack config file and command line options, then
30 - # configure logging.
31 + # Parse config file and command line options,
32 + # then configure logging.
33 cfg.CONF(sys.argv[1:])
34 logging.setup('ceilometer.api')
36 - # Set up the pecan configuration
37 - filename = api_config.__file__.replace('.pyc', '.py')
38 - pecan_config = configuration.conf_from_file(filename)
40 - # Build the WSGI app
41 - root = app.setup_app(pecan_config,
42 - extra_hooks=[acl.AdminAuthHook()])
43 - root = acl.install(root, cfg.CONF)
45 - # Create the WSGI server and start it
46 - host, port = '0.0.0.0', int(cfg.CONF.metering_api_port)
47 - srv = simple_server.make_server(host, port, root)
49 - print 'Starting server in PID %s' % os.getpid()
51 - if host == '0.0.0.0':
52 - print 'serving on 0.0.0.0:%s, view at http://127.0.0.1:%s' % \
55 - print "serving on http://%s:%s" % (host, port)
59 - except KeyboardInterrupt:
60 - # allow CTRL+C to shutdown without an error
62 + root = app.make_app()
65 + if cfg.CONF.verbose or cfg.CONF.debug:
68 + root.run(host='0.0.0.0', port=cfg.CONF.metering_api_port)