From: Angus Salkeld Date: Mon, 4 Jun 2012 11:16:31 +0000 (+1000) Subject: Teach heat-api about the bind_host X-Git-Tag: 2014.1~1762 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=93ea554c0e72fa02b9cbdaf616b905039faf8d79;p=openstack-build%2Fheat-build.git Teach heat-api about the bind_host Change-Id: Ica32693373a87f01c41755a2b041c187bddd034d Signed-off-by: Angus Salkeld --- diff --git a/bin/heat-api b/bin/heat-api index 998b24a2..26f03b7d 100755 --- a/bin/heat-api +++ b/bin/heat-api @@ -51,8 +51,9 @@ if __name__ == '__main__': app = config.load_paste_app(conf) - port = config.DEFAULT_PORT - LOG.info(('Starting Heat API on port %s') % port) - httpserver.serve(app, port=port) + port = conf.bind_port + host = conf.bind_host + LOG.info(('Starting Heat API on %s:%s') % (host, port)) + httpserver.serve(app, host=host, port=port) except RuntimeError, e: sys.exit("ERROR: %s" % e) diff --git a/heat/common/config.py b/heat/common/config.py index 7e86ad50..a2bc16d9 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -137,12 +137,17 @@ rpc_opts = [ class HeatConfigOpts(cfg.CommonConfigOpts): def __init__(self, default_config_files=None, **kwargs): + config_files = cfg.find_config_files(project='heat', + prog='heat-api') super(HeatConfigOpts, self).__init__( project='heat', version='%%prog %s' % version.version_string(), default_config_files=default_config_files, **kwargs) - self.register_cli_opts(rpc_opts) + opts = [cfg.IntOpt('bind_port', default=8000), + cfg.StrOpt('bind_host', default='127.0.0.1')] + opts.extend(rpc_opts) + self.register_cli_opts(opts) class HeatMetadataConfigOpts(cfg.CommonConfigOpts):