Skip to content

Commit

Permalink
added check for router port
Browse files Browse the repository at this point in the history
  • Loading branch information
John McDowall committed Feb 22, 2016
1 parent da75f4d commit b26c49e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions neutron/db/db_base_plugin_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,9 +1207,15 @@ def create_port(self, context, port):
# jmcdowall begin hack
# allowing port to be created with no fixed_ip address
#
fixed_ips = db_port['fixed_ips']
LOG.info("Value of fixed IPS is: %s\n", fixed_ips)
if fixed_ips:
is_router_port = (
p['device_owner'] in constants.ROUTER_INTERFACE_OWNERS_SNAT)
if is_router_port:
LOG.info("is router port")
ips = self.ipam.allocate_ips_for_port_and_store(context, port,
port_id)
else:
fixed_ips = p['fixed_ips']
LOG.info("Value of fixed IPS is: %s\n", fixed_ips)
#
# Fixed IPS only exist for network ports
#
Expand All @@ -1219,11 +1225,9 @@ def create_port(self, context, port):
port_id)
else:
LOG.info("Not creating IPAN fixed_ips %s\n",fixed_ips)
else:
ips = self.ipam.allocate_ips_for_port_and_store(context, port,
port_id)
#
# jmcdowall end hack
#
if ('dns-integration' in self.supported_extension_aliases and
'dns_name' in p):
dns_assignment = []
Expand Down

0 comments on commit b26c49e

Please sign in to comment.