Adds version reporting for heat commands

Adds --version option for following commands
heat-api-cfn
heat-api-cloudwatch
heat-keystone-setup-domain

Change-Id: I84bdf16fd053b5eccacd99bf26ecd9eb34e57ef8
Closes-bug: #1435406
This commit is contained in:
Kanagaraj Manickam 2015-03-24 12:35:17 +05:30
parent b738ee677f
commit cc95fcc5d8
3 changed files with 14 additions and 3 deletions

View File

@ -43,6 +43,7 @@ from heat.common import messaging
from heat.common import profiler
from heat.common import wsgi
from heat.openstack.common import systemd
from heat import version
i18n.enable_lazy()
@ -51,7 +52,9 @@ LOG = logging.getLogger('heat.api.cfn')
if __name__ == '__main__':
try:
logging.register_options(cfg.CONF)
cfg.CONF(project='heat', prog='heat-api-cfn')
cfg.CONF(project='heat',
prog='heat-api-cfn',
version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cfn')
logging.set_defaults()
messaging.setup()

View File

@ -43,6 +43,7 @@ from heat.common import messaging
from heat.common import profiler
from heat.common import wsgi
from heat.openstack.common import systemd
from heat import version
i18n.enable_lazy()
@ -51,7 +52,9 @@ LOG = logging.getLogger('heat.api.cloudwatch')
if __name__ == '__main__':
try:
logging.register_options(cfg.CONF)
cfg.CONF(project='heat', prog='heat-api-cloudwatch')
cfg.CONF(project='heat',
prog='heat-api-cloudwatch',
version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cloudwatch')
logging.set_defaults()
messaging.setup()

View File

@ -20,6 +20,8 @@ import keystoneclient.exceptions as kc_exception
from keystoneclient.v3 import client
from oslo_config import cfg
from heat import version
logger = logging.getLogger(__name__)
DEBUG = False
@ -53,7 +55,10 @@ opts = [
]
cfg.CONF.register_cli_opts(opts)
cfg.CONF(sys.argv[1:], project='heat', prog='heat-keystone-setup-domain')
cfg.CONF(sys.argv[1:],
project='heat',
prog='heat-keystone-setup-domain',
version=version.version_info.version_string())
HEAT_DOMAIN_NAME = os.environ.get(
'HEAT_DOMAIN', cfg.CONF.stack_user_domain_name)