summaryrefslogtreecommitdiff
path: root/heat/cmd/engine.py
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2016-07-26 13:55:20 -0400
committerDan Prince <dprince@redhat.com>2016-10-13 11:49:15 -0400
commit1486289a757c765f9d42916bb16469c1948486ef (patch)
tree5b4481030f42ef74a4909969a6bfcc35d840ce18 /heat/cmd/engine.py
parent0a2e21b40f9c7b35ef448384c89fa1bd98c5de55 (diff)
downloadheat-1486289a757c765f9d42916bb16469c1948486ef.tar.gz
heat-all: all-in-one heat launcher
This patch implements a new heat-all command that can be used to launch a single process version of the configured heat services. The end user can control which services are launched by setting 'enabled_services' in the heat config file: [heat_all] enabled_services = api,engine One use case for this launcher would be to launch a single process heat using rpc_backend = fake, connection=sqlite://heat.db, to have access to a minimal all in one Heat API/Engine for TripleO undercloud deployments via Heat templates. Change-Id: Ic35bdc455fe1397ac575522af0c8fca96dd95676
Diffstat (limited to 'heat/cmd/engine.py')
-rw-r--r--heat/cmd/engine.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/heat/cmd/engine.py b/heat/cmd/engine.py
index d3858943a..41cf8008a 100644
--- a/heat/cmd/engine.py
+++ b/heat/cmd/engine.py
@@ -44,12 +44,14 @@ i18n.enable_lazy()
LOG = logging.getLogger('heat.engine')
-def main():
- logging.register_options(cfg.CONF)
+def launch_engine(setup_logging=True):
+ if setup_logging:
+ 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()
+ if setup_logging:
+ logging.setup(cfg.CONF, 'heat-engine')
+ logging.set_defaults()
messaging.setup()
config.startup_sanity_check()
@@ -76,4 +78,9 @@ def main():
# 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()
+ return launcher
+
+
+def main():
+ launcher = launch_engine()
launcher.wait()