Remove EXTERNAL_NETWORK callbacks

external networks are not really independent resources that
have their own lifecycles independent from networks. The only
use cases for this callback can be achieved with just regular
NETWORK callbacks.

The only users of this event have been adjusted to use NETWORK
callbacks (according to codesearch.openstack.org).

Closes-Bug: #1678041
Change-Id: Ie8249ddc3de643bfcb5c97480f30dc3500699256
This commit is contained in:
Kevin Benton 2017-04-04 00:06:52 -07:00
parent 07d19fcb37
commit cc59e9f159
2 changed files with 0 additions and 19 deletions

View File

@ -12,7 +12,6 @@
# String literals representing core resources.
AGENT = 'agent'
EXTERNAL_NETWORK = 'external_network'
FLOATING_IP = 'floatingip'
NETWORK = 'network'
NETWORKS = 'networks'

View File

@ -22,7 +22,6 @@ from sqlalchemy.sql import expression as expr
from neutron._i18n import _
from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import exceptions as c_exc
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import _model_query as model_query
@ -103,26 +102,9 @@ class External_net_db_mixin(object):
context.session.add(rbac_db.NetworkRBAC(
object_id=net_data['id'], action='access_as_external',
target_tenant='*', tenant_id=net_data['tenant_id']))
try:
registry.notify(
resources.EXTERNAL_NETWORK, events.PRECOMMIT_CREATE,
self, context=context,
request=req_data, network=net_data)
except c_exc.CallbackFailure as e:
# raise the underlying exception
raise e.errors[0].error
net_data[external_net.EXTERNAL] = external
def _process_l3_update(self, context, net_data, req_data, allow_all=True):
try:
registry.notify(
resources.EXTERNAL_NETWORK, events.BEFORE_UPDATE,
self, context=context,
request=req_data, network=net_data)
except c_exc.CallbackFailure as e:
# raise the underlying exception
raise e.errors[0].error
new_value = req_data.get(external_net.EXTERNAL)
net_id = net_data['id']
if not validators.is_attr_set(new_value):