def _gateway_added(self, ex_gw_port, interface_name):
"""Add Floating IP gateway port."""
+ LOG.debug("add gateway interface(%s)", interface_name)
ns_name = self.get_name()
self.driver.plug(ex_gw_port['network_id'],
ex_gw_port['id'],
def create(self):
# TODO(Carl) Get this functionality from mlavelle's namespace baseclass
+ LOG.debug("add fip-namespace(%s)", self.name)
ip_wrapper_root = ip_lib.IPWrapper()
ip_wrapper_root.netns.execute(['sysctl',
'-w',
"""
self.agent_gateway_port = agent_gateway_port
- # add fip-namespace and agent_gateway_port
self.create()
iface_name = self.get_ext_device_name(agent_gateway_port['id'])
def create_rtr_2_fip_link(self, ri):
"""Create interface between router and Floating IP namespace."""
+ LOG.debug("Create FIP link interfaces for router %s", ri.router_id)
rtr_2_fip_name = self.get_rtr_ext_device_name(ri.router_id)
fip_2_rtr_name = self.get_int_device_name(ri.router_id)
fip_ns_name = self.get_name()
ip_cidr for ip_cidr in existing_cidrs - new_cidrs
if common_utils.is_cidr_host(ip_cidr))
for ip_cidr in fips_to_remove:
+ LOG.debug("Removing floating ip %s from interface %s in "
+ "namespace %s", ip_cidr, interface_name, self.ns_name)
self.remove_floating_ip(device, ip_cidr)
return fip_statuses
def _internal_network_added(self, ns_name, network_id, port_id,
fixed_ips, mac_address,
interface_name, prefix):
+ LOG.debug("adding internal network: prefix(%s), port(%s)",
+ prefix, port_id)
self.driver.plug(network_id, port_id, interface_name, mac_address,
namespace=ns_name,
prefix=prefix)
def internal_network_removed(self, port):
interface_name = self.get_internal_device_name(port['id'])
-
+ LOG.debug("removing internal network: port(%s) interface(%s)",
+ port['id'], interface_name)
if ip_lib.device_exists(interface_name, namespace=self.ns_name):
self.driver.unplug(interface_name, namespace=self.ns_name,
prefix=INTERNAL_DEV_PREFIX)
enable_ra = False
for p in new_ports:
self.internal_network_added(p)
+ LOG.debug("appending port %s to internal_ports cache", p)
self.internal_ports.append(p)
enable_ra = enable_ra or self._port_has_ipv6_subnet(p)
for p in old_ports:
self.internal_network_removed(p)
+ LOG.debug("removing port %s from internal_ports cache", p)
self.internal_ports.remove(p)
enable_ra = enable_ra or self._port_has_ipv6_subnet(p)
self.internal_ports[index] = updated_ports[p['id']]
interface_name = self.get_internal_device_name(p['id'])
ip_cidrs = common_utils.fixed_ip_cidrs(p['fixed_ips'])
+ LOG.debug("updating internal network for port %s", p)
self.internal_network_updated(interface_name, ip_cidrs)
enable_ra = enable_ra or self._port_has_ipv6_subnet(p)
def _external_gateway_added(self, ex_gw_port, interface_name,
ns_name, preserve_ips):
+ LOG.debug("External gateway added: port(%s), interface(%s), ns(%s)",
+ ex_gw_port, interface_name, ns_name)
self._plug_external_gateway(ex_gw_port, interface_name, ns_name)
# Build up the interface and gateway IP addresses that
ex_gw_port, interface_name, self.ns_name, preserve_ips)
def external_gateway_removed(self, ex_gw_port, interface_name):
+ LOG.debug("External gateway removed: port(%s), interface(%s)",
+ ex_gw_port, interface_name)
self.driver.unplug(interface_name,
bridge=self.agent_conf.external_network_bridge,
namespace=self.ns_name,
:param agent: Passes the agent in order to send RPC messages.
"""
+ LOG.debug("process router updates")
self._process_internal_ports()
self.process_external(agent)
# Process static routes for router
associated to removed ips
extra_subnets: An iterable of cidrs to add as routes without address
"""
+ LOG.debug("init_router_port: device_name(%s), namespace(%s)",
+ device_name, namespace)
self.init_l3(device_name=device_name,
ip_cidrs=ip_cidrs,
namespace=namespace,
device.route.list_onlink_routes(n_const.IP_VERSION_4) +
device.route.list_onlink_routes(n_const.IP_VERSION_6))
for route in new_onlink_routes - existing_onlink_routes:
+ LOG.debug("adding onlink route(%s)", route)
device.route.add_onlink_route(route)
for route in existing_onlink_routes - new_onlink_routes:
+ LOG.debug("deleting onlink route(%s)", route)
device.route.delete_onlink_route(route)
def check_bridge_exists(self, bridge):