From: Dirk Mueller Date: Fri, 19 Jul 2013 21:04:14 +0000 (+0200) Subject: Add help option to Config Settings X-Git-Tag: 2014.1~266^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=62fe3126cf5927d4e4744835fbc273189cde6d0d;p=openstack-build%2Fheat-build.git Add help option to Config Settings This way it is possible to generate the config files from the used config values automatically (like done e.g. in other OpenStack modules) Change-Id: I2683743330a8d3589637d967e16b5ba130bd45e1 --- diff --git a/etc/heat/heat.conf.sample b/etc/heat/heat.conf.sample index f1fc6ff7..594a216c 100644 --- a/etc/heat/heat.conf.sample +++ b/etc/heat/heat.conf.sample @@ -84,10 +84,10 @@ # Options defined in heat.common.policy # -# (string value) +# Policy file to use (string value) #policy_file=policy.json -# (string value) +# Default Rule of Policy File (string value) #policy_default_rule=default @@ -95,22 +95,26 @@ # Options defined in heat.common.wsgi # -# (string value) +# Address to bind the server. Useful when selecting a +# particular network interface. (string value) #bind_host=0.0.0.0 -# (integer value) +# The port on which the server will listen. (integer value) #bind_port= -# (integer value) +# Number of backlog requests to configure the socket with +# (integer value) #backlog=4096 -# (string value) +# Location of the SSL Certificate File to use for SSL mode +# (string value) #cert_file= -# (string value) +# Location of the SSL Key File to use for enabling SSL mode +# (string value) #key_file= -# (integer value) +# Number of workers for Heat service (integer value) #workers=0 @@ -432,7 +436,7 @@ # Options defined in heat.common.config # -# (string value) +# The flavor to use (string value) #flavor= # The API paste config file to use (string value) @@ -455,10 +459,10 @@ # Options defined in heat.api.aws.ec2token # -# (string value) +# Authentication Endpoint URI (string value) #auth_uri= -# (string value) +# Keystone EC2 Service Endpoint URI (string value) #keystone_ec2_uri= diff --git a/heat/api/aws/ec2token.py b/heat/api/aws/ec2token.py index c87af290..996fb006 100644 --- a/heat/api/aws/ec2token.py +++ b/heat/api/aws/ec2token.py @@ -34,8 +34,12 @@ logger = logging.getLogger(__name__) opts = [ - cfg.StrOpt('auth_uri', default=None), - cfg.StrOpt('keystone_ec2_uri', default=None) + cfg.StrOpt('auth_uri', + default=None, + help=_("Authentication Endpoint URI")), + cfg.StrOpt('keystone_ec2_uri', + default=None, + help=_("Keystone EC2 Service Endpoint URI")) ] cfg.CONF.register_opts(opts, group='ec2authtoken') diff --git a/heat/common/config.py b/heat/common/config.py index 8113ec12..b17b704d 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -33,9 +33,10 @@ DEFAULT_PORT = 8000 paste_deploy_group = cfg.OptGroup('paste_deploy') paste_deploy_opts = [ - cfg.StrOpt('flavor'), + cfg.StrOpt('flavor', + help=_("The flavor to use")), cfg.StrOpt('api_paste_config', default="api-paste.ini", - help="The API paste config file to use")] + help=_("The API paste config file to use"))] service_opts = [ diff --git a/heat/common/policy.py b/heat/common/policy.py index 59c81f27..94833cd5 100644 --- a/heat/common/policy.py +++ b/heat/common/policy.py @@ -32,8 +32,12 @@ from heat.openstack.common.gettextutils import _ logger = logging.getLogger(__name__) policy_opts = [ - cfg.StrOpt('policy_file', default='policy.json'), - cfg.StrOpt('policy_default_rule', default='default'), + cfg.StrOpt('policy_file', + default='policy.json', + help=_("Policy file to use")), + cfg.StrOpt('policy_default_rule', + default='default', + help=_("Default Rule of Policy File")) ] CONF = cfg.CONF diff --git a/heat/common/wsgi.py b/heat/common/wsgi.py index f108fe68..26d20685 100644 --- a/heat/common/wsgi.py +++ b/heat/common/wsgi.py @@ -54,21 +54,31 @@ URL_LENGTH_LIMIT = 50000 eventlet.wsgi.MAX_REQUEST_LINE = URL_LENGTH_LIMIT bind_opts = [ - cfg.StrOpt('bind_host', default='0.0.0.0'), - cfg.IntOpt('bind_port'), + cfg.StrOpt('bind_host', default='0.0.0.0', + help=_('Address to bind the server. Useful when ' + 'selecting a particular network interface.')), + cfg.IntOpt('bind_port', + help=_('The port on which the server will listen.')) ] cfg.CONF.register_opts(bind_opts) socket_opts = [ - cfg.IntOpt('backlog', default=4096), - cfg.StrOpt('cert_file'), - cfg.StrOpt('key_file'), + cfg.IntOpt('backlog', default=4096, + help=_("Number of backlog requests " + "to configure the socket with")), + cfg.StrOpt('cert_file', default=None, + help=_("Location of the SSL Certificate File " + "to use for SSL mode")), + cfg.StrOpt('key_file', default=None, + help=_("Location of the SSL Key File to use " + "for enabling SSL mode")), ] cfg.CONF.register_opts(socket_opts) -workers_opts = cfg.IntOpt('workers', default=0) +workers_opts = cfg.IntOpt('workers', default=0, + help=_("Number of workers for Heat service")) cfg.CONF.register_opt(workers_opts)