Move the default port number into common.config
It was defined in multiple places. Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
parent
0f6375a931
commit
82888427f3
7
bin/heat
7
bin/heat
|
@ -44,14 +44,13 @@ gettext.install('heat', unicode=1)
|
||||||
|
|
||||||
from heat import client as heat_client
|
from heat import client as heat_client
|
||||||
from heat.common import exception
|
from heat.common import exception
|
||||||
|
from heat.common import config
|
||||||
from heat import version
|
from heat import version
|
||||||
|
|
||||||
|
|
||||||
SUCCESS = 0
|
SUCCESS = 0
|
||||||
FAILURE = 1
|
FAILURE = 1
|
||||||
|
|
||||||
DEFAULT_PORT = 8000
|
|
||||||
|
|
||||||
def catch_error(action):
|
def catch_error(action):
|
||||||
"""Decorator to provide sensible default error handling for actions."""
|
"""Decorator to provide sensible default error handling for actions."""
|
||||||
def wrap(func):
|
def wrap(func):
|
||||||
|
@ -223,14 +222,14 @@ def create_options(parser):
|
||||||
help="Address of heat API host. "
|
help="Address of heat API host. "
|
||||||
"Default: %default")
|
"Default: %default")
|
||||||
parser.add_option('-p', '--port', dest="port", metavar="PORT",
|
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. "
|
help="Port the heat API host listens on. "
|
||||||
"Default: %default")
|
"Default: %default")
|
||||||
parser.add_option('-U', '--url', metavar="URL", default=None,
|
parser.add_option('-U', '--url', metavar="URL", default=None,
|
||||||
help="URL of heat service. This option can be used "
|
help="URL of heat service. This option can be used "
|
||||||
"to specify the hostname, port and protocol "
|
"to specify the hostname, port and protocol "
|
||||||
"(http/https) of the heat server, for example "
|
"(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")
|
"/v1 Default: No<F3>ne")
|
||||||
parser.add_option('-k', '--insecure', dest="insecure",
|
parser.add_option('-k', '--insecure', dest="insecure",
|
||||||
default=False, action="store_true",
|
default=False, action="store_true",
|
||||||
|
|
|
@ -48,7 +48,7 @@ if __name__ == '__main__':
|
||||||
app = config.load_paste_app(conf)
|
app = config.load_paste_app(conf)
|
||||||
|
|
||||||
server = wsgi.Server()
|
server = wsgi.Server()
|
||||||
server.start(app, conf, default_port=DEFAULT_PORT)
|
server.start(app, conf, default_port=config.DEFAULT_PORT)
|
||||||
server.wait()
|
server.wait()
|
||||||
except RuntimeError, e:
|
except RuntimeError, e:
|
||||||
sys.exit("ERROR: %s" % e)
|
sys.exit("ERROR: %s" % e)
|
||||||
|
|
|
@ -38,7 +38,6 @@ class V1Client(base_client.BaseClient):
|
||||||
|
|
||||||
"""Main client class for accessing heat resources"""
|
"""Main client class for accessing heat resources"""
|
||||||
|
|
||||||
DEFAULT_PORT = 8000
|
|
||||||
DEFAULT_DOC_ROOT = "/v1"
|
DEFAULT_DOC_ROOT = "/v1"
|
||||||
|
|
||||||
def _insert_common_parameters(self, params):
|
def _insert_common_parameters(self, params):
|
||||||
|
|
|
@ -28,6 +28,7 @@ from heat import version
|
||||||
from heat.common import cfg
|
from heat.common import cfg
|
||||||
from heat.common import wsgi
|
from heat.common import wsgi
|
||||||
|
|
||||||
|
DEFAULT_PORT = 8000
|
||||||
|
|
||||||
paste_deploy_group = cfg.OptGroup('paste_deploy')
|
paste_deploy_group = cfg.OptGroup('paste_deploy')
|
||||||
paste_deploy_opts = [
|
paste_deploy_opts = [
|
||||||
|
|
Loading…
Reference in New Issue