Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing #77

Open
wants to merge 3 commits into
base: n1kv-juno-plus-basic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions neutron/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
FLOATINGIP_STATUS_ACTIVE = 'ACTIVE'
FLOATINGIP_STATUS_DOWN = 'DOWN'
FLOATINGIP_STATUS_ERROR = 'ERROR'
PORT_STATUS_NOTAPPLICABLE = 'N/A'

DEVICE_OWNER_ROUTER_HA_INTF = "network:router_ha_interface"
DEVICE_OWNER_ROUTER_INTF = "network:router_interface"
Expand Down
36 changes: 26 additions & 10 deletions neutron/db/l3_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,16 +777,32 @@ def create_floatingip(self, context, floatingip,
# This external port is never exposed to the tenant.
# it is used purely for internal system and admin use when
# managing floating IPs.
external_port = self._core_plugin.create_port(context.elevated(), {
'port':
{'tenant_id': '', # tenant intentionally not set
'network_id': f_net_id,
'mac_address': attributes.ATTR_NOT_SPECIFIED,
'fixed_ips': attributes.ATTR_NOT_SPECIFIED,
'admin_state_up': True,
'device_id': fip_id,
'device_owner': DEVICE_OWNER_FLOATINGIP,
'name': ''}})
#external_port = self._core_plugin.create_port(context.elevated(), {
# 'port':
#{'tenant_id': '', # tenant intentionally not set
#'network_id': f_net_id,
#'mac_address': attributes.ATTR_NOT_SPECIFIED,
#'fixed_ips': attributes.ATTR_NOT_SPECIFIED,
#'admin_state_up': True,
#'device_id': fip_id,
#'device_owner': DEVICE_OWNER_FLOATINGIP,
#'name': ''}})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dead code

port = {'tenant_id': '', # tenant intentionally not set
'network_id': f_net_id,
'mac_address': attributes.ATTR_NOT_SPECIFIED,
'fixed_ips': attributes.ATTR_NOT_SPECIFIED,
'admin_state_up': True,
'device_id': fip_id,
'device_owner': DEVICE_OWNER_FLOATINGIP,
'status': l3_constants.PORT_STATUS_NOTAPPLICABLE,
'name': ''}

if fip.get('floating_ip_address'):
port['fixed_ips'] = [
{'ip_address': fip['floating_ip_address']}]

external_port = self._core_plugin.create_port(context.elevated(),
{'port': port})
# Ensure IP addresses are allocated on external port
if not external_port['fixed_ips']:
raise n_exc.ExternalIpAddressExhausted(net_id=f_net_id)
Expand Down
2 changes: 1 addition & 1 deletion neutron/extensions/l3.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class RouterExternalGatewayInUseByFloatingIp(qexception.InUse):
'validate': {'type:uuid': None},
'is_visible': True,
'primary_key': True},
'floating_ip_address': {'allow_post': False, 'allow_put': False,
'floating_ip_address': {'allow_post': True, 'allow_put': False,
'validate': {'type:ip_address_or_none': None},
'is_visible': True},
'floating_network_id': {'allow_post': True, 'allow_put': False,
Expand Down