Merge "Remove EXTERNAL_NETWORK callbacks"
This commit is contained in:
commit
6ecdfbb82b
@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
# String literals representing core resources.
|
# String literals representing core resources.
|
||||||
AGENT = 'agent'
|
AGENT = 'agent'
|
||||||
EXTERNAL_NETWORK = 'external_network'
|
|
||||||
FLOATING_IP = 'floatingip'
|
FLOATING_IP = 'floatingip'
|
||||||
NETWORK = 'network'
|
NETWORK = 'network'
|
||||||
NETWORKS = 'networks'
|
NETWORKS = 'networks'
|
||||||
|
@ -22,7 +22,6 @@ from sqlalchemy.sql import expression as expr
|
|||||||
from neutron._i18n import _
|
from neutron._i18n import _
|
||||||
from neutron.api.v2 import attributes
|
from neutron.api.v2 import attributes
|
||||||
from neutron.callbacks import events
|
from neutron.callbacks import events
|
||||||
from neutron.callbacks import exceptions as c_exc
|
|
||||||
from neutron.callbacks import registry
|
from neutron.callbacks import registry
|
||||||
from neutron.callbacks import resources
|
from neutron.callbacks import resources
|
||||||
from neutron.db import _model_query as model_query
|
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(
|
context.session.add(rbac_db.NetworkRBAC(
|
||||||
object_id=net_data['id'], action='access_as_external',
|
object_id=net_data['id'], action='access_as_external',
|
||||||
target_tenant='*', tenant_id=net_data['tenant_id']))
|
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
|
net_data[external_net.EXTERNAL] = external
|
||||||
|
|
||||||
def _process_l3_update(self, context, net_data, req_data, allow_all=True):
|
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)
|
new_value = req_data.get(external_net.EXTERNAL)
|
||||||
net_id = net_data['id']
|
net_id = net_data['id']
|
||||||
if not validators.is_attr_set(new_value):
|
if not validators.is_attr_set(new_value):
|
||||||
|
Loading…
Reference in New Issue
Block a user