from neutron.plugins.cisco.db import network_db_v2
from neutron.plugins.cisco.extensions import n1kv_profile
from neutron.plugins.cisco.n1kv import n1kv_client
-from neutron import policy
LOG = logging.getLogger(__name__)
if physical_network not in self.network_vlan_ranges:
self.network_vlan_ranges[physical_network] = []
- def _check_provider_view_auth(self, context, network):
- return policy.check(context,
- "extension:provider_network:view",
- network)
-
- def _enforce_provider_set_auth(self, context, network):
- return policy.enforce(context,
- "extension:provider_network:set",
- network)
-
def _extend_network_dict_provider(self, context, network):
"""Add extended network parameters."""
binding = n1kv_db_v2.get_network_binding(context.session,
segmentation_id_set):
return (None, None, None)
- # Authorize before exposing plugin details to client
- self._enforce_provider_set_auth(context, attrs)
-
if not network_type_set:
msg = _("provider:network_type required")
raise q_exc.InvalidInput(error_message=msg)
segmentation_id_set):
return
- # Authorize before exposing plugin details to client
- self._enforce_provider_set_auth(context, attrs)
-
# TBD : Need to handle provider network updates
msg = _("plugin does not support updating provider attributes")
raise q_exc.InvalidInput(error_message=msg)
from neutron.openstack.common import log as logging
from neutron.plugins.plumgrid.common import exceptions as plum_excep
from neutron.plugins.plumgrid.plumgrid_plugin.plugin_ver import VERSION
-from neutron import policy
LOG = logging.getLogger(__name__)
PLUM_DRIVER = 'neutron.plugins.plumgrid.drivers.plumlib.Plumlib'
return VERSION
def _port_viftype_binding(self, context, port):
- if self._check_view_auth(context, port, self.binding_view):
- port[portbindings.VIF_TYPE] = portbindings.VIF_TYPE_IOVISOR
- port[portbindings.CAPABILITIES] = {
- portbindings.CAP_PORT_FILTER:
- 'security-group' in self.supported_extension_aliases}
+ port[portbindings.VIF_TYPE] = portbindings.VIF_TYPE_IOVISOR
+ port[portbindings.CAPABILITIES] = {
+ portbindings.CAP_PORT_FILTER:
+ 'security-group' in self.supported_extension_aliases}
return port
- def _check_view_auth(self, context, resource, action):
- return policy.check(context, action, resource)
-
def _network_admin_state(self, network):
try:
if network["network"].get("admin_state_up"):