Commit Graph

61 Commits

Author SHA1 Message Date
ricolin
4188c40beb Remove warnings in heat
Use warning in oslo_log instead.

Change-Id: I7c2cfe3cbd7ac8b1a5870cd53633342c5622ef0b
2016-01-20 22:00:52 +08:00
Peter Razumovsky
2f9ea624de Fix [H405] pep rule in bin
Implements bp docstring-improvements

Change-Id: If2daff413814fe0a7b5d5fbc4e2262b06aa90c5e
2015-10-08 15:13:52 +03:00
Sirushti Murugesan
063f80ffdf 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
2015-09-03 02:03:59 +00:00
zhangchunlong1@huawei.com
1e49aad113 Introduce Guru Meditation Reports into Heat
This commit integrates functionality from the `openstack.common.report`
module into Heat. This enables Heat services to receive SIGUSR1 and
print a Guru Meditation Report to stderr or file. The required modules
were added to 'openstack-common.conf' as well.

Change-Id: I36af98590e5556f012b0e9f79e21585e216b7280
Blueprint: guru-meditation-report
Co-Authored-By: huangtianhua <huangtianhua@huawei.com>
2015-07-02 16:55:25 +08:00
Sergey Vilgelm
432430d2c6 Switch to oslo.service
oslo.service has graduated, so heat should consume it.

Change-Id: I9c1899eb37505e64967e9cb77da23bb169498aba
Closes-Bug: #1466851
2015-06-23 08:30:39 +02:00
Jenkins
068d6bd3df Merge "passed version information while parsing arguments" 2015-03-24 04:00:18 +00:00
Angus Salkeld
a47639c4a4 Move stack_user_domain warning to startup
Add a startup_warnings() function in place to add other
warnings there if at all possible.

Change-Id: I4d8d02feccc42c2f3486f52bad488922eb08bbca
Closes-bug: 1434286
2015-03-23 13:07:55 +10:00
rajiv
0f4fee91b9 passed version information while parsing arguments
Change-Id: I1b9dd4a1353799f5001349f973f5d06ddd104069
Closes-Bug: #1432527
2015-03-22 12:33:44 +00:00
Jens Rosenboom
a99fe6a760 Make import of oslo libraries namespaceless
See https://blueprints.launchpad.net/oslo-incubator/+spec/drop-namespace-packages

Closes-Bug: 1423174
Change-Id: I48680ce6e7ce91005c147ab4388203946171d433
2015-02-18 22:54:10 +01:00
Steven Hardy
70112c103a Move logging to use oslo_log library
The oslo-incubator log modlule has been removed, so port to the oslo_log
library.  Note this uses the new (non namespaced, e.g oslo.log) import
convention, we'll need to align other imports in a future commit.

Some import reordering was required due to pedantic H30[57] checks, and
the services have all been converted to initialize the oslo_log library
as this is done differently to the log.py in incubator.

Change-Id: Ib5a97123fe1b287bc531e42d7887c13ba6205628
2015-02-17 09:23:34 +00:00
Pavlo Shchelokovskyy
4279bd2923 Enable H305 and H307 style checks
Correct grouping and ordering of imports

Change-Id: I47ea0d53f80d7f0aeb01c1c6afd63713be87ddf4
2015-01-20 09:47:25 +02:00
Tetiana Lashchova
ed76af4269 Check that template format plugins are registered
Otherwise log an error and exit

Change-Id: I2beb33371cf5e6701e22dbb41c8f5aa681c379de
Closes-Bug: #1402426
2014-12-16 12:41:36 +02:00
Angus Salkeld
a98d2c9c5d Add OSprofiler integration into Heat
This adds builtin rpc and db traces to Heat, as well as
some toplevel stack methods to aid in reading the output.

A 'profiler' config group is added to enable profiling.

Change-Id: Ie5c1c8f1931f59e4d4bcf1ec3b791f55984eb6d2
Closes-bug: #1363782
2014-10-03 15:40:25 +10:00
Angus Salkeld
33eb87b3e2 Add an option to disable cloud watch lite
This also adds a deprecation warning.
This also changes the default to use Ceilometer.

Release message:
Anyone deploying Heat should not be using OS::Heat::CWLiteAlarm, but
OS::Ceilometer::Alarm.
CWLiteAlarm should be explictly disabled in /etc/heat/heat.conf by
setting "enable_cloud_watch_lite=false". This will stop Heat from
running a period task check for alarms.

DocImpact
Change-Id: I2a10c14772bdafc001e211d7e94502ac1f6b32b1
Closes-bug: #1322128
2014-09-25 19:42:28 +10:00
Ethan Lynn
d5c449ab32 Import oslo.i18n and port heat bins to use oslo.i18n
Import oslo.i18n and port heat bins to use oslo.i18n

blueprint oslo-i18n

Change-Id: If30df87d7d2b8047225f0c413d338ace975062b1
2014-09-02 10:53:14 +08:00
Steve Baker
d70da16894 Detect neutron endpoint on-the-fly
This change does the following:
- reverts commit 04de60093b
- reimplements Resource.is_using_neutron to check for neutron by
  attempting to create a neutron client
- fix mocking in tests for changes which landed after 04de600

If there is no 'network' entry in the service catalog then
keystoneclient will raise an EndpointNotFound. The context will
already have a keystone client cached which has a full service catalog
locally, so calling is_using_neutron should have no particular overhead.

This fixes a tripleo regression where the autodetection is triggered
before keystone is ready, so that heat-engine fails to start. This
race does not affect devstack as keystone is fully configured before
heat services are started.

Not adding config option networking_service will also prevent
extra work required by downstream installation tools.

Change-Id: I45a6154fa560f672d8d1942bf57f39601110bfc6
Closes-Bug: #1362812
2014-08-29 11:11:59 +12:00
Pavlo Shchelokovskyy
04de60093b Allow to decide between Nova-network and Neutron
Adds a heat.conf option to set the OpenStack component responsible for
networking, and makes heat-engine auto-discover the networking service
on start up if such option is not set.
Also adds a convenience method to Resource class to let resources decide
what networking service to use.

Implements blueprint discover-networking-service

Change-Id: If7121089068cc2d2774bedb73e4e252b520eb5b3
2014-08-27 16:41:25 +03:00
Jenkins
8249ed170f Merge "Refactor service readiness notification" 2014-08-08 08:17:57 +00:00
Jenkins
b6304d4f8d Merge "Stop overriding CONF.default_log_levels per binary" 2014-07-17 10:41:31 +00:00
Alan Pevec
46d6b9306c Refactor service readiness notification
Build upon cceda95a35 apply Oslo systemd
module. It was imported in aef33d2d71. It
also drops heat.common.systemd and deprecates onready configuration
parameter.

Oslo commit 53e1214c092f09e3851b1a1b55289a93a72b09ec

Change-Id: I80f325c9be9c171c2dc8d5526570bf64f0f87c78
2014-07-16 11:01:52 +02:00
Thomas Herve
9090b988e6 Port to oslo.messaging
Move from oslo RPC to oslo.messaging.

Implements: blueprint oslo-messaging
Co-Authored-By: sdake@redhat.com
Change-Id: I2d222c248dd2cd405b8ec35c4c8198ed001fb69f
2014-06-26 06:45:52 +02:00
Joe Gordon
8208c64df3 Stop overriding CONF.default_log_levels per binary
Overriding CONF.default_log_levels means we loose some explicitly set
default values such as 'iso8601=WARN'. Also explicitly overriding
CONF.default_log_levels means that default_log_levels cannot be set in a
config file.

Change-Id: Ib5103b88ec3f9ccd9d516032c6a13dc2fa4bcb5e
2014-06-17 15:43:43 -07:00
Steven Hardy
507555a585 Move Engine initialization into service start()
Currently we create the ThreadGroupManager and EngineListener
objects in the service constructor, which is not necessarily
going to work if multiple worker processes are specified in
the config file (which fork multiple workers after the constructor).

The ThreadGroupManager appears to work, even when it is created before
the fork, but this is due to some magic in the oslo ProcessLauncher
implementation which decouples parent/child use of the eventlet hub.

So instead, we move all service startup code into the start() method,
which is the entry point for services, triggered via the oslo Services
class run_service method:

- Don't create anything common to the workers in the constructor
- Move ThreadGroup and EngineListener creation into start()
- Create the periodic tasks from bin/heat-engine, which means
  the periodic tasks will only be created by the parent, not
  duplicated in every worker process.

These changes should mean we work correctly with both the ServiceLauncher
(num_engine_workers==1) and ProcessLauncher(num_engine_workers>1) oslo
abstractions, and solves the issues observed when running multiple
workers with the impl_qpid rpc_backend.

Change-Id: If3a11050a03660560a364dec871f85c4b56c1c25
Closes-Bug: #1321303
2014-06-01 08:20:49 +01:00
Ethan Lynn
f864a0c84a Re-enable lazy translation
After enhancements to Oslo Message class, re-enable lazy translation to
enable REST API responses to be translated to the requested user locale.
bp i18n-messages
Change-Id: I4be508858547029d454412746609fd380af415c1
2014-05-27 18:29:01 +08:00
Pavlo Shchelokovskyy
50ff4ec2fe Order imports in alphabetical order (9/9)
This patch fixes all the missed and newly introduced violations of the H306
style checking rule and enables it in tox.

Change-Id: I5566e66421d5397c0103958f02ea38e6e3c68892
Implements: blueprint reduce-flake8-ignored-rules (partial)
2014-05-22 16:49:51 +03:00
Clint Byrum
6d308d53e8 Revert "Default engine workers to the number of CPUs"
This reverts commit 5604168784.

Problems have been reported on systems using QPID. The gate only tests
RabbitMQ.

Change-Id: Iaf83dc7582835ce5bf4534116c918640da7373aa
Partial-Bug: #1321303
2014-05-20 10:15:23 -07:00
Clint Byrum
5604168784 Default engine workers to the number of CPUs
The engine is single-threaded and thus needs more workers to handle more
concurrent requests on a single machine.

Change-Id: I36117c3876f84a2ff7ba5576444fdbf7716cc69e
2014-05-15 12:24:18 -04:00
Clint Byrum
0bb12320f5 Allow setting the number of heat engine workers
This will allow scaling stack operations up on a single host.

Change-Id: I8e9a3a7f86663fdda9b03c42e16b3e2189cbbfa5
2014-05-14 17:49:28 -04:00
Jason Dunsmore
af464c9afc Make the first line of every file consistent.
Change-Id: I2e1a809cfca8e88693551d58d33e747f54ee5eb1
2014-03-04 09:03:04 -06:00
Jason Dunsmore
97135cbfc0 Remove vim header from files.
Change-Id: Ia6131f8fcac6902c80c80aa805c8cd7a2a41f280
Closes-Bug: #1229324
2014-03-04 08:51:56 -06:00
Jenkins
56bacbda1b Merge "Add systemd notification support to heat" 2014-02-19 23:22:19 +00:00
Lon Hohberger
cceda95a35 Add systemd notification support to heat
This mirrors work done in other OpenStack projects
to add systemd notification support to signal that
a given process is ready to accept requests.

The heat-api, heat-api-cfn, heat-engine, and
heat-api-cloudwatch processes are all covered by
a new, single, 'onready' configuration file option.

Additionally, the sample configuration file has been
updated to match.

Implements: blueprint systemd-integration

Change-Id: I90d2b915e2568a65ed9ed78923c9982e19f9c948
Signed-off-by: Lon Hohberger <lhh@redhat.com>
2014-02-19 09:43:44 -05:00
Thomas Herve
8b1b7d132e Revert "Merge "Re-enable lazy translation""
Revert enabling lazy translation, which doesn't work in many places
because we're doing string concatenation.

This reverts commit 1864efa320, reversing
changes made to 92e3e3ce74.

Closes-Bug: #1281644
Change-Id: Iac0be685f8bb60f81715c0dd3dbe35787e38ee39
2014-02-18 18:58:28 +01:00
cbjchen@cn.ibm.com
fa133569a4 Re-enable lazy translation
After enhancements to Oslo Message class, re-enable lazy translation to
enable REST API responses to be translated to the requested user locale.

bp i18n-messages

Change-Id: I15ecffd678393c27c34336035d37915655e9f350
2014-02-16 02:12:37 +00:00
Alexander Gordeev
4582a1a0dd Migrate to Oslo DB 96d1f887dda Part 3
Oslo version 96d1f887dda21b43ba4376187f31953dee6f5273

This commit just migrates Heat to new db related code from Oslo

Partially implements blueprint oslo-db-support

Change-Id: Ib0de40a70857fb3e029a2282f06746269a628c71
2013-10-09 13:13:30 +04:00
Ben Nemec
53b9314799 Disable lazy translation
Late in the Havana cycle bug 1225099 was found in the lazy
translation code, and to be safe it was decided to disable lazy
translation for Havana.  This change does that.

Change-Id: Ia934a7df9386baf6ae8eb9ff48c24386c47ecd23
Partial-bug: 1225099
2013-10-01 21:41:55 +00:00
Luis A. Garcia
9004239b9f Enable localizable REST API responses via the Accept-Language header
Add support for doing language resolution for a request, based on the
Accept-Language HTTP header. Using the lazy gettext functionality, from
oslo gettextutils, it is possible to use the resolved language to
translate exception messages to the user requested language and
return that translation from the API.

The patch removes individually imported _() so they don't replace the
one installed service-wide.

Also, it adds the ability to fully re-create a remote error
with the same kwargs with which it was originally created, so that we
can translate it and show it to the user.

Partially implements bp user-locale-api.

Change-Id: I63edc8463836bfff257daa8a2c66ed5d3a444254
2013-08-03 00:19:17 +00:00
Julien Danjou
f2ef092d8c Update oslo.notifier and always register options
This avoids registering multiple times the option if the registering
functions are called multiple path by different code paths. It's
necessary for the default configuration sample generator to have options
only registered once.

The update of oslo.notifier is needed to avoid it using the inexistant
$host option.

Change-Id: If31974d7ef7fdbf85a88e950ff06c60ccbd6c31d
Signed-off-by: Julien Danjou <julien@danjou.info>
2013-07-11 15:45:52 +02:00
Liang Chen
48b243b35e install "_" via gettextutils
avoid using two separate sets of translation messages when
HEAT_LOCALEDIR environment variable presents.

Fixes bug #1196184

Change-Id: Ief773b9f2674909de461e2b07f1b07d3c66521cc
2013-06-30 14:42:41 +08:00
Steven Hardy
2db9b282a0 heat engine : register options before using them
Fix regression caused by the __init__.py refactoring, which means
we try to use cfg.CONF.host before registering it.

fixes bug #1174302

Change-Id: Iff4d75f53e242d7df8c7071cbeeead034a7ad9b0
2013-04-29 14:21:35 +01:00
Mark McLoughlin
117e73ba57 Remove engine_topic configuration option
Fixes bug #1173575

This is currently broken since heat-engine always listens to the
'engine' topic and there isn't actually a good use case for this to be
configurable, so let's kill it.

Change-Id: I35c0292c921f81857f80a7f111df5ac330d54ecf
2013-04-27 13:27:26 +01:00
Angus Salkeld
f9f11a5bc3 Use oslo logging setup.
The one reason we kept our own version was because of the qpid
logging that is quite useful. But this is now easily done via
the "default_log_levels" option.

I have setup the api servers with:
 ampqlib,qpid.messaging,keystone,eventlet
and the engine with:
 ampqlib,qpid.messaging,keystone,eventlet,sqlalchemy

bug: 1143629
Change-Id: I04eeab469ab59da550e08188d53b2cfbb576c04d
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-03-04 17:00:47 +11:00
Mark McLoughlin
150d2ca694 Use oslo-config-2013.1b3
The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.

Add the 2013.1b3 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.

Add dependency_links to setup.py so that oslo-config can be installed
from the tarball URL specified in pip-requires.

Remove the 'deps = pep8==1.3.4' from tox.ini as it means all the other
deps get installed with easy_install which can't install oslo-config
from the URL.

Excluded code from oslo-incubator in the pep8 check.

Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
2013-02-18 17:27:14 +00:00
Steven Hardy
c1bf924c0f heat cleanups to align with pep8 1.3.4
Lots of (mostly whitespace) cleanups to align all the non-test code with
pep8 v1.3.4

ref bug 1092057

Change-Id: I444b288444dba4ec1da5854bd276d091c06d8489
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-12-20 09:26:16 +00:00
Zane Bitter
180df199fe Automatically register engine options
Register the engine options as soon as we import something from the engine
package. This means we do not need to explicitly do it in all of the unit
tests.

Change-Id: I8fb0c8665d0e0255521e21a6aac223ad1e3b1b25
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-11-30 17:05:13 +01:00
Zane Bitter
658a839665 Process engine config before initialisation
Don't import the heat-engine service module until the configuration options
have been initialised. This will allow us to read the configuration during
initialisation of the engine.

Change-Id: I2bc70d903434eac1fa248640018f038c5ef2bead
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-11-29 20:51:47 +01:00
Angus Salkeld
8135da2fb4 Use openstack-common service.py
Change-Id: Idbc145209c039e9362cf97c9926e050f809ef0fa
2012-11-02 22:02:00 +11:00
Steven Dake
e9eee939c7 Import openstack.common.rpc
Use openstack.common routines.  One of the parameters changed to
create_consumer().

Thanks to Russell Bryant for assistance with sorting out that problem.

Change-Id: I4badc7ca22298cd0aafc57a2335b3d6801289be8
Signed-off-by: Steven Dake <sdake@redhat.com>
2012-07-17 08:27:19 -07:00
Steven Dake
b0a0f0c24e Use global cfg.CONF instead of config classes
Importing rpc.common requires the use of the global cfg.CONF.
In fact, most of common requires the use of this global.  This
patch removes all the object specific access to config options
and directly accesses the global in prep for rpc openstack-common
import.

Change-Id: I5989a436964c199df0dc38dbb191dc3d867e5ce7
Signed-off-by: Steven Dake <sdake@redhat.com>
2012-07-17 07:18:42 -07:00
Steven Dake
c7ec88f2c7 Import openstack.common.log and use inside heat infrastructure
Allows heat to match openstack-common log calling conventions such
as using a context object or instance UUID for better traceability.

Change-Id: Idaa6c04270d9d7143c85988d685c0f9e241b635b
Signed-off-by: Steven Dake <sdake@redhat.com>
2012-07-14 13:51:38 -07:00