]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Move the default port number into common.config
authorAngus Salkeld <asalkeld@redhat.com>
Thu, 15 Mar 2012 23:12:45 +0000 (10:12 +1100)
committerAngus Salkeld <asalkeld@redhat.com>
Thu, 15 Mar 2012 23:12:45 +0000 (10:12 +1100)
It was defined in multiple places.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
bin/heat
bin/heat-api
heat/client.py
heat/common/config.py

index f3be4a5b9eb61de664ea20770387cbb7a3012aea..5a43b671f58425c95cc8edf597b8bb26770cd845 100755 (executable)
--- a/bin/heat
+++ b/bin/heat
@@ -44,14 +44,13 @@ gettext.install('heat', unicode=1)
 
 from heat import client as heat_client
 from heat.common import exception
+from heat.common import config
 from heat import version
 
 
 SUCCESS = 0
 FAILURE = 1
 
-DEFAULT_PORT = 8000
-
 def catch_error(action):
     """Decorator to provide sensible default error handling for actions."""
     def wrap(func):
@@ -223,14 +222,14 @@ def create_options(parser):
                       help="Address of heat API host. "
                            "Default: %default")
     parser.add_option('-p', '--port', dest="port", metavar="PORT",
-                      type=int, default=DEFAULT_PORT,
+                      type=int, default=config.DEFAULT_PORT,
                       help="Port the heat API host listens on. "
                            "Default: %default")
     parser.add_option('-U', '--url', metavar="URL", default=None,
                       help="URL of heat service. This option can be used "
                            "to specify the hostname, port and protocol "
                            "(http/https) of the heat server, for example "
-                           "-U https://localhost:" + str(DEFAULT_PORT) +
+                           "-U https://localhost:" + str(config.DEFAULT_PORT) +
                            "/v1 Default: No<F3>ne")
     parser.add_option('-k', '--insecure', dest="insecure",
                       default=False, action="store_true",
index 26016f44adf2d7f61311b0490069b6b9a70729a3..77afe9d1f2392389a9371386535157545c2a738f 100755 (executable)
@@ -48,7 +48,7 @@ if __name__ == '__main__':
         app = config.load_paste_app(conf)
 
         server = wsgi.Server()
-        server.start(app, conf, default_port=DEFAULT_PORT)
+        server.start(app, conf, default_port=config.DEFAULT_PORT)
         server.wait()
     except RuntimeError, e:
         sys.exit("ERROR: %s" % e)
index 88dbf517c5e0b7e9f263eac0ab68b7285f20f66d..c8002c27fa85a34744d751258cf09a4b117c9f81 100644 (file)
@@ -38,7 +38,6 @@ class V1Client(base_client.BaseClient):
 
     """Main client class for accessing heat resources"""
 
-    DEFAULT_PORT = 8000
     DEFAULT_DOC_ROOT = "/v1"
 
     def _insert_common_parameters(self, params):
index ae84325f883cc6cb908ce05f2818c5dcb8f2e265..b412e1f8d37dca3c45a8420b99648ede2bb64fcf 100644 (file)
@@ -28,6 +28,7 @@ from heat import version
 from heat.common import cfg
 from heat.common import wsgi
 
+DEFAULT_PORT = 8000
 
 paste_deploy_group = cfg.OptGroup('paste_deploy')
 paste_deploy_opts = [