Commit Graph

18 Commits

Author SHA1 Message Date
Stephen Finucane b72980960e Remove hooks
This extension point was deprecated in 13.0.0 (Mitaka) as it was
unmaintainable. Now, over four years later, it's finally time to remove
them. A combination of notifications, versioned or otherwise, and
dynamic vendordata should be used instead.

Change-Id: Idb9a0c06d8abdb158bcee5be12c35dcb67257e60
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-05-27 09:41:36 +00:00
Stephen Finucane 3a28b0e771 trivial: Remove remaining '_LW' instances
There are only a few of these remaining in the code base. Remove them.

Change-Id: I33725e2439b0f39c1e9bec9e33a37bf3e24944fb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-05-18 17:00:41 +01:00
Stephen Finucane eee57f2380 trivial: Remove remaining '_LE' instances
We've been slowly removing these as we go. Remove the final few '_LE'
occurrences now.

Change-Id: I75ebd2e95a0c77585d7b4329ca01e4bacc1dd7c4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-05-18 16:52:20 +01:00
Sean Dague 7be5644270 Deprecate nova.hooks
This emits a warning message when hooks are used to ensure that admins
understand that this facility is deprecated in Nova going forward. It
also removes the links to the meager documentation on hooks to ensure
no one finds these by accident and starts using them. Also add a
comment to the code file itself incase someone ends up in it from
other searches.

Change-Id: I31b1223a0dc3fdffe356a816b591fdd88a31483a
2016-03-01 11:52:52 +00:00
Davanum Srinivas 97d63d8745 Use oslo.log
Convert the use of the incubated version of the log module
to the new oslo.log library.

Sync oslo-incubator modules to update their imports as well.

Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
Change-Id: Ic4932e3f58191869c30bd07a010a6e9fdcb2a12c
2015-02-22 07:56:40 -05:00
Davanum Srinivas 62712d9fb0 Update hooks from oslo-incubator copy
Collapse identical methods for pre/post into one method. Copy
over documentation as well. We are getting rid of oslo-incubator's
copy of hooks.py in the following change id, so from now on
nova has the only copy of this module

If55b37ccb20d9bc520909490f4f00de4ed430638

Change-Id: Ie43913fc847ee7ce247862f53c14a2daec433224
2014-10-28 01:24:31 +00:00
Davanum Srinivas 11aaf21d9e docs - Fix errors,warnings from document generation
SEVERE: Unexpected section title.
ERROR: Unexpected indentation.
WARNING: Block quote ends without a blank line; unexpected unindent.
WARNING: Definition list ends without a blank line; unexpected unindent.
WARNING: Field list ends without a blank line; unexpected unindent.
WARNING: Inline emphasis start-string without end-string.
WARNING: Inline interpreted text or phrase reference start-string without end-string.
WARNING: Inline strong start-string without end-string.

Partial-Bug: #1351350

Change-Id: I661e0e32519f8e4de3325efd10242824015ed03d
2014-08-08 22:07:31 +00:00
Davanum Srinivas 826aed0ec7 Use oslo.i18n
oslo.i18n provides the i18n functions that were provided by
oslo-incubator's gettextutils module. Some tests that were
using internal details of the library were removed.

Change-Id: I44cfd5552e0dd86af21073419d31622f5fdb28e0
2014-07-18 14:28:09 -04:00
Andrew Melton cf6d43d774 Enhance and test exception safety in hooks
This patch adds exception handling when calling pre and
post functions of hooks. Exceptions will be caught and
logged, but the hook chain and function call will be
allowed to proceed.

Partially implements: bp instance-network-info-hook

Change-Id: I45e76cd156c244ff57f77db103a9a579f14ad4f1
2014-06-17 15:37:36 -04:00
Jenkins 51fd513d3a Merge "Add testing for hooks" 2014-06-17 14:20:30 +00:00
Gary Kotton 4dcf093236 Don't translate debug level logs in nova
Our translation policy
(https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls
for not translating debug level logs. This is to help prioritize log
translation. Furthermore translation has a performance overhead, even if
the log isn't used (since nova doesn't support lazy translation yet).

This is the final patch ensuring that all fines in the nova directory
no longer have translations for debug messages.

Change-Id: Ib10f5826e2238cbb2d4315c48be570eb31b2ea55
2014-06-13 01:07:48 -07:00
Andrew Melton 7d43493ae3 Add testing for hooks
Partially implements: bp instance-network-info-hook

Change-Id: Ie7cfcf70ff39f1273d97b17788c2e4e0f9fc437f
2014-06-10 11:35:23 -04:00
liu-sheng 74f953a1d7 Remove vi modelines
We don't need to have the vi modelines in each source file,
it can be set in a user's vimrc if required.

Also a check is added to hacking to detect if they are re-added.

Change-Id: I347307a5145b2760c69085b6ca850d6a9137ffc6
Closes-Bug: #1229324
2014-02-03 14:19:44 +00:00
Alex Gaynor cd9d8e45c6 Remove the monkey patching of _ into the builtins
Previous _ was monkey patched into builtins whenever
certain modules were imported. This removes that and
simply imports it when it is needed.

Change-Id: I0af2c6d8a230e94440d655d13cab9107ac20d13c
2013-07-26 07:31:17 -07:00
Eugene Nikanorov 20eac6c1df Remove locals() from various places.
fixes bug 1171936

Remove usage of locals() for string formatting

Change-Id: Ib05538095086ddefdb486c84da506af662ec5c9b
2013-07-17 09:30:48 +04:00
Daniel L Jones 3dbc333263 Added functionality for nova hooks pass functions
Nova hooks do not pass the function they wrap to the hook
as a parameter. This patch adds an optional parameter to
add_hook which will change the function signatures for pre
and post, enabling hooks to acquire and use information
about the function they are wrapped around.

Additionally adds a unit test for the new hooks in test_hooks.py.

Change-Id: Ie328b2460ef0e063892944c97934c12076ed4979
2013-07-02 12:56:45 -05:00
Kurt Taylor d17f9ab13d Update OpenStack LLC to Foundation
Update all references of "LLC" to "Foundation".

Change-Id: I009e86784ef4dcf38882d64b0eff484576e04efe
2013-02-26 19:15:29 -05:00
Brian Elliott e937a53065 Add generic customization hooks via decorator.
Hooks add the ability to insert custom code around operations that
declare a named hook:

e.g.

@hooks.add_hooks('create_instance')
def create_instance(....):
   ....

The above hook allows Hook objects to be run 'pre' and 'post' the
execution of create_instance()

Hook objects are discovered via the setuptools entry point group
'nova.hooks'.

Change-Id: I3961df12ef415085de7459438967edacc34500c2
2012-11-30 20:47:53 +00:00