diff options
author | Sirushti Murugesan <sirushti.murugesan@hp.com> | 2015-09-02 08:21:25 +0530 |
---|---|---|
committer | Rico Lin <rico.l@inwinstack.com> | 2015-09-03 02:03:59 +0000 |
commit | 063f80ffdf47ace831aac133e3e5d98a66d64392 (patch) | |
tree | be9ad9c3a4cb26fd92aacc41f2096c83b78e4f94 /heat/cmd/engine.py | |
parent | c79bd02e28e399cd7c1079010954c639b4ae62f2 (diff) | |
download | heat-063f80ffdf47ace831aac133e3e5d98a66d64392.tar.gz |
Add console_scripts entry points for all heat services
As a follow-up to Ibfd54e7b1bae700e4fb49a32e5bf7c00d1f104d9,
moving all the scripts from bin/ to setuptools entry points.
The devstack change is here: Iffb6d09bfef593d854b38e68200ae6039c4727e7
partial blueprint upgrade-tests
Change-Id: Ic8f5b8dc85098de752bbf673c4b15c06fdc4162a
Diffstat (limited to 'heat/cmd/engine.py')
-rwxr-xr-x | heat/cmd/engine.py | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/heat/cmd/engine.py b/heat/cmd/engine.py new file mode 100755 index 000000000..1574a5a60 --- /dev/null +++ b/heat/cmd/engine.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +""" +Heat Engine Server. This does the work of actually implementing the API +calls made by the user. Normal communications is done via the heat API +which then calls into this engine. +""" + +import eventlet +eventlet.monkey_patch() + +import sys + +from oslo_config import cfg +import oslo_i18n as i18n +from oslo_log import log as logging +from oslo_reports import guru_meditation_report as gmr +from oslo_service import service + +from heat.common import config +from heat.common.i18n import _LC +from heat.common import messaging +from heat.common import profiler +from heat.engine import template +from heat.rpc import api as rpc_api +from heat import version + +i18n.enable_lazy() + +LOG = logging.getLogger('heat.engine') + + +def main(): + logging.register_options(cfg.CONF) + cfg.CONF(project='heat', prog='heat-engine', + version=version.version_info.version_string()) + logging.setup(cfg.CONF, 'heat-engine') + logging.set_defaults() + messaging.setup() + + config.startup_sanity_check() + + mgr = None + try: + mgr = template._get_template_extension_manager() + except template.TemplatePluginNotRegistered as ex: + LOG.critical(_LC("%s"), ex) + if not mgr or not mgr.names(): + sys.exit("ERROR: No template format plugins registered") + + from heat.engine import service as engine # noqa + + profiler.setup('heat-engine', cfg.CONF.host) + gmr.TextGuruMeditation.setup_autorun(version) + srv = engine.EngineService(cfg.CONF.host, rpc_api.ENGINE_TOPIC) + launcher = service.launch(cfg.CONF, srv, + workers=cfg.CONF.num_engine_workers) + if cfg.CONF.enable_cloud_watch_lite: + # We create the periodic tasks here, which mean they are created + # only in the parent process when num_engine_workers>1 is specified + srv.create_periodic_tasks() + launcher.wait() |