Skip to content

Commit f1ebc15

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Remove hooks"
2 parents 07acbe8 + b729809 commit f1ebc15

File tree

9 files changed

+113
-439
lines changed

9 files changed

+113
-439
lines changed

nova/compute/api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
from nova.db.sqlalchemy import api as db_api
5959
from nova import exception
6060
from nova import exception_wrapper
61-
from nova import hooks
6261
from nova.i18n import _
6362
from nova.image import glance
6463
from nova.network import constants
@@ -1927,7 +1926,6 @@ def _check_multiple_instances_with_specified_ip(self, requested_networks):
19271926
"is specified.")
19281927
raise exception.InvalidFixedIpAndMaxCountRequest(reason=msg)
19291928

1930-
@hooks.add_hook("create_instance")
19311929
def create(self, context, instance_type,
19321930
image_href, kernel_id=None, ramdisk_id=None,
19331931
min_count=None, max_count=None,

nova/compute/manager.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
import nova.context
7474
from nova import exception
7575
from nova import exception_wrapper
76-
from nova import hooks
7776
from nova.i18n import _
7877
from nova.image import glance
7978
from nova import manager
@@ -2114,7 +2113,6 @@ def _check_trusted_certs(self, instance):
21142113
'Trusted image certificates provided on host that does not '
21152114
'support certificate validation.')
21162115

2117-
@hooks.add_hook('build_instance')
21182116
@wrap_exception()
21192117
@reverts_task_state
21202118
@wrap_instance_event(prefix='compute')
@@ -2896,7 +2894,6 @@ def _cleanup_volumes(self, context, instance, bdms, raise_exc=True,
28962894
if exc_info is not None and raise_exc:
28972895
six.reraise(exc_info[0], exc_info[1], exc_info[2])
28982896

2899-
@hooks.add_hook("delete_instance")
29002897
def _delete_instance(self, context, instance, bdms):
29012898
"""Delete an instance on this host.
29022899

nova/hooks.py

Lines changed: 0 additions & 167 deletions
This file was deleted.

nova/network/neutron.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from nova import context as nova_context
3838
from nova.db import base
3939
from nova import exception
40-
from nova import hooks
4140
from nova.i18n import _
4241
from nova.network import constants
4342
from nova.network import model as network_model
@@ -102,7 +101,6 @@ def get_binding_profile(port):
102101
return port.get(constants.BINDING_PROFILE, {}) or {}
103102

104103

105-
@hooks.add_hook('instance_network_info')
106104
def update_instance_cache_with_nw_info(impl, context, instance, nw_info=None):
107105
if instance.deleted:
108106
LOG.debug('Instance is deleted, no further info cache update',

nova/test.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -750,12 +750,6 @@ class NoDBTestCase(TestCase):
750750
USES_DB = False
751751

752752

753-
class BaseHookTestCase(NoDBTestCase):
754-
def assert_has_hook(self, expected_name, func):
755-
self.assertTrue(hasattr(func, '__hook_name__'))
756-
self.assertEqual(expected_name, func.__hook_name__)
757-
758-
759753
class MatchType(object):
760754
"""Matches any instance of a specified type
761755

nova/tests/unit/compute/test_compute.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13383,18 +13383,3 @@ def test_cpu_thread_policy(self):
1338313383
self.compute_api._validate_flavor_image,
1338413384
self.context, image['id'], image, self.instance_type,
1338513385
None)
13386-
13387-
13388-
class ComputeHooksTestCase(test.BaseHookTestCase):
13389-
def test_delete_instance_has_hook(self):
13390-
delete_func = compute_manager.ComputeManager._delete_instance
13391-
self.assert_has_hook('delete_instance', delete_func)
13392-
13393-
def test_create_instance_has_hook(self):
13394-
create_func = compute.API.create
13395-
self.assert_has_hook('create_instance', create_func)
13396-
13397-
def test_build_instance_has_hook(self):
13398-
build_instance_func = (compute_manager.ComputeManager.
13399-
_do_build_and_run_instance)
13400-
self.assert_has_hook('build_instance', build_instance_func)

0 commit comments

Comments
 (0)