From 7a28922d1e564182a901781f8055f4eb7bcb1405 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Mon, 7 May 2012 18:25:03 +1000 Subject: [PATCH] Metadata: Add bind_host to the config This needs to be set to the nova interface to work. Signed-off-by: Angus Salkeld --- bin/heat-metadata | 11 +++++------ heat/common/config.py | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/heat-metadata b/bin/heat-metadata index 701a7ec5..985e0e32 100755 --- a/bin/heat-metadata +++ b/bin/heat-metadata @@ -39,13 +39,11 @@ from heat.common import config from heat.common import wsgi from heat import context from paste import httpserver -from socket import gethostbyname, gethostname LOG = logging.getLogger('heat.metadata') -def send_address_to_engine(port): - host = gethostbyname(gethostname()) +def send_address_to_engine(host, port): con = context.get_admin_context() resp = rpc.call(con, 'engine', {'method': 'metadata_register_address', @@ -63,8 +61,9 @@ if __name__ == '__main__': app = config.load_paste_app(conf) port = conf.bind_port - send_address_to_engine(port) - LOG.info(('Starting Heat Metadata on port %s') % port) - httpserver.serve(app, port=port) + host = conf.bind_host + send_address_to_engine(host, port) + LOG.info(('Starting Heat Metadata 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 2d26e53e..0902a676 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -148,7 +148,8 @@ class HeatMetadataConfigOpts(cfg.CommonConfigOpts): version='%%prog %s' % version.version_string(), default_config_files=default_config_files, **kwargs) - opts = [cfg.IntOpt('bind_port', default=8000)] + 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) -- 2.45.2