[sdnve]
# (ListOpt) The IP address of one (or more) SDN-VE controllers
-# Default value is : controller_ips = 127.0.0.1
+# Default value is: controller_ips = 127.0.0.1
# Example: controller_ips = 127.0.0.1,127.0.0.2
# (StrOpt) The integration bridge for OF based implementation
# The default value for integration_bridge is None
# Example: out_of_band = False
#
# (BoolOpt) The fake controller for testing purposes
-# Default value is : use_fake_controller = False
+# Default value is: use_fake_controller = False
# (StrOpt) The port number for use with controller
# The default value for the port is 8443
# Example: port = 8443
# Example: password = sdnve_password
#
# (StrOpt) The default type of tenants (and associated resources)
-# Default value for OF is: default_tenant = OF
-# Example: default_tenant = OVERLAY
+# Available choices are: OVERLAY or OF
+# The default value for tenant type is OVERLAY
+# Example: default_tenant_type = OVERLAY
# (StrOpt) The string in tenant description that indicates
# Default value for OF tenants: of_signature = SDNVE-OF
# (StrOpt) The string in tenant description that indicates
cfg.ListOpt('interface_mappings',
default=DEFAULT_INTERFACE_MAPPINGS,
help=_("List of <physical_network_name>:<interface_name>")),
- cfg.StrOpt('default_tenant_type', default='OF',
- help=_("Tenant type: OF (default) and OVERLAY")),
+ cfg.StrOpt('default_tenant_type', default='OVERLAY',
+ help=_("Tenant type: OVERLAY (default) or OF")),
cfg.StrOpt('overlay_signature', default='SDNVE-OVERLAY',
help=_("The string in tenant description that indicates "
"the tenant is a OVERLAY tenant")),
body = dict(
(k.replace(':', '_'), v) for k, v in body.items()
if attributes.is_attr_set(v))
+ return body
def sdnve_list(self, resource, **params):
'''Fetches a list of resources.'''
LOG.info(_("Bad resource for forming a create request"))
return 0, ''
- self.process_request(body)
+ body = self.process_request(body)
status, data = self.post(res, body=body)
return (status, data)
LOG.info(_("Bad resource for forming a update request"))
return 0, ''
- self.process_request(body)
+ body = self.process_request(body)
return self.put(res + specific, body=body)
def sdnve_delete(self, resource, specific):
from oslo.config import cfg
-from neutron.common import constants as q_const
+from neutron.common import constants as n_const
from neutron.common import exceptions as n_exc
-from neutron.common import rpc as q_rpc
+from neutron.common import rpc as n_rpc
from neutron.common import topics
from neutron.db import agents_db
from neutron.db import db_base_plugin_v2
from neutron.db import external_net_db
from neutron.db import l3_gwmode_db
from neutron.db import portbindings_db
+from neutron.db import quota_db # noqa
from neutron.extensions import portbindings
from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging
If a manager would like to set an rpc API version, or support more than
one class as the target of rpc messages, override this method.
'''
- return q_rpc.PluginRpcDispatcher([self,
+ return n_rpc.PluginRpcDispatcher([self,
agents_db.AgentExtRpcCallback()])
def sdnve_info(self, rpc_context, **kwargs):
__native_sorting_support = False
supported_extension_aliases = ["binding", "router", "external-net",
- "agent"]
+ "agent", "quotas"]
def __init__(self, configfile=None):
self.base_binding_dict = {
session = context.session
# Set port status as 'ACTIVE' to avoid needing the agent
- port['port']['status'] = q_const.PORT_STATUS_ACTIVE
+ port['port']['status'] = n_const.PORT_STATUS_ACTIVE
port_data = port['port']
with session.begin(subtransactions=True):
context, id, router)
if processed_request['router']:
+ egw = processed_request['router'].get('external_gateway_info')
+ # Check for existing empty set (different from None) in request
+ if egw == {}:
+ processed_request['router'][
+ 'external_gateway_info'] = {'network_id': 'null'}
(res, data) = self.sdnve_client.sdnve_update(
'router', id, processed_request['router'])
if res not in constants.HTTP_ACCEPTABLE:
{'router_id': router_id, 'interface_info': interface_info})
subnet_id = interface_info.get('subnet_id')
+ port_id = interface_info.get('port_id')
if not subnet_id:
- portid = interface_info.get('port_id')
- if not portid:
+ if not port_id:
raise sdnve_exc.BadInputException(msg=_('No port ID'))
- myport = super(SdnvePluginV2, self).get_port(context, portid)
+ myport = super(SdnvePluginV2, self).get_port(context, port_id)
LOG.debug(_("SdnvePluginV2.remove_router_interface port: %s"),
myport)
myfixed_ips = myport.get('fixed_ips')
LOG.debug(
_("SdnvePluginV2.remove_router_interface subnet_id: %s"),
subnet_id)
+ else:
+ if not port_id:
+ # The backend requires port id info in the request
+ subnet = super(SdnvePluginV2, self).get_subnet(context,
+ subnet_id)
+ df = {'device_id': [router_id],
+ 'device_owner': [n_const.DEVICE_OWNER_ROUTER_INTF],
+ 'network_id': [subnet['network_id']]}
+ ports = self.get_ports(context, filters=df)
+ if ports:
+ pid = ports[0]['id']
+ interface_info['port_id'] = pid
+ msg = ("SdnvePluginV2.remove_router_interface "
+ "subnet_id: %(sid)s port_id: %(pid)s")
+ LOG.debug(msg, {'sid': subnet_id, 'pid': pid})
(res, data) = self.sdnve_client.sdnve_update(
'router', router_id + '/remove_router_interface', interface_info)