Merge "Allow specifying a listen IP"

This commit is contained in:
Jenkins 2013-05-28 22:35:27 +00:00 committed by Gerrit Code Review
commit 7c6c0bf0dd
4 changed files with 30 additions and 13 deletions

View File

@ -42,7 +42,7 @@ if __name__ == '__main__':
root = app.VersionSelectorApplication()
# Create the WSGI server and start it
host, port = '0.0.0.0', int(cfg.CONF.metering_api_port)
host, port = cfg.CONF.api.host, cfg.CONF.api.port
srv = simple_server.make_server(host, port, root)
LOG = log.getLogger(__name__)

View File

@ -20,9 +20,20 @@ from oslo.config import cfg
# Register options for the service
API_SERVICE_OPTS = [
cfg.IntOpt('metering_api_port',
cfg.IntOpt('port',
default=8777,
deprecated_name='metering_api_port',
deprecated_group='DEFAULT',
help='The port for the ceilometer API server',
),
cfg.StrOpt('host',
default='0.0.0.0',
help='The listen IP for the ceilometer API server',
),
]
cfg.CONF.register_opts(API_SERVICE_OPTS)
CONF = cfg.CONF
opt_group = cfg.OptGroup(name='api',
title='Options for the ceilometer-api service')
CONF.register_group(opt_group)
CONF.register_opts(API_SERVICE_OPTS, opt_group)

View File

@ -48,14 +48,6 @@
#os_auth_url=http://localhost:5000/v2.0
#
# Options defined in ceilometer.api
#
# The port for the ceilometer API server (integer value)
#metering_api_port=8777
#
# Options defined in ceilometer.api.app
#
@ -515,6 +507,19 @@
#cinder_control_exchange=cinder
[api]
#
# Options defined in ceilometer.api
#
# The port for the ceilometer API server (integer value)
#port=8777
# The listen IP for the ceilometer API server (string value)
#host=0.0.0.0
[publisher_udp]
#

View File

@ -72,8 +72,6 @@ class BinApiTestCase(base.TestCase):
policy_file = self.path_get('tests/policy.json')
with open(self.tempfile, 'w') as tmp:
tmp.write("[DEFAULT]\n")
tmp.write(
"metering_api_port=%s\n" % self.api_port)
tmp.write(
"rpc_backend=ceilometer.openstack.common.rpc.impl_fake\n")
tmp.write("database_connection=log://localhost\n")
@ -85,6 +83,9 @@ class BinApiTestCase(base.TestCase):
"pipeline_cfg_file=%s\n" % pipeline_cfg_file)
tmp.write(
"policy_file=%s\n" % policy_file)
tmp.write("[api]\n")
tmp.write(
"port=%s\n" % self.api_port)
self.subp = subprocess.Popen([self.path_get('bin/ceilometer-api'),
"--config-file=%s" % self.tempfile])