]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Teach heat-api about the bind_host
authorAngus Salkeld <asalkeld@redhat.com>
Mon, 4 Jun 2012 11:16:31 +0000 (21:16 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Mon, 4 Jun 2012 11:16:31 +0000 (21:16 +1000)
Change-Id: Ica32693373a87f01c41755a2b041c187bddd034d
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
bin/heat-api
heat/common/config.py

index 998b24a2d5bf9829e4e32dcf266c04e41f8bac15..26f03b7d880445c3c5f7cee9e70df5dd2e86c0c5 100755 (executable)
@@ -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)
index 7e86ad50cf765f33f847aaca21c91b9bcd84a8aa..a2bc16d92f413d453136f5ef14ac7401e335a6cb 100644 (file)
@@ -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):