import ovs.unixctl.server
import ovs.vlog
from six.moves import range
+import six
VERSION = "0.99"
ovs_ofctl("add-flow %s priority=0,action=drop" % self.short_name)
def cleanup_ls(self):
- for port_no, tun_name, remote_ip in self.tunnels.itervalues():
+ for port_no, tun_name, remote_ip in six.itervalues(self.tunnels):
del_bfd(remote_ip)
def update_flood(self):
- flood_ports = self.ports.values()
+ flood_ports = list(self.ports.values())
# Traffic flowing from one 'unknown-dst' should not be flooded to
# port belonging to another 'unknown-dst'.
for tunnel in old_tunnels.difference(tunnels):
self.del_tunnel(tunnel)
- for mac in remote_macs.keys():
+ for mac in six.iterkeys(remote_macs):
if (self.remote_macs.get(mac) != remote_macs[mac]):
self.add_remote_mac(mac, remote_macs[mac])
- for mac in self.remote_macs.keys():
+ for mac in six.iterkeys(self.remote_macs):
if mac not in remote_macs:
self.del_remote_mac(mac)
# Go through all the logical switch's interfaces that end with "-l"
# and copy the statistics to logical_binding_stats.
- for interface in self.ports.iterkeys():
+ for interface in six.iterkeys(self.ports):
if not interface.endswith("-l"):
continue
# Physical ports can have a '-' as part of its name.
if not uuid:
continue
- for (mapfrom, mapto) in stats_map.iteritems():
+ for mapfrom, mapto in six.iteritems(stats_map):
value = ovs_vsctl("get interface %s statistics:%s"
% (interface, mapfrom)).strip('"')
vtep_ctl("set logical_binding_stats %s %s=%s"
'bfd_params:check_tnl_key': 'false'}
bfd_params_values = {}
- for key, default in bfd_params_default.iteritems():
+ for key, default in six.iteritems(bfd_params_default):
column = vtep_ctl("--if-exists get tunnel %s %s"
% (tunnel, key))
if not column:
else:
bfd_params_values[key] = column
- for key, value in bfd_params_values.iteritems():
+ for key, value in six.iteritems(bfd_params_values):
new_key = key.replace('_params', '')
ovs_vsctl("set interface %s %s=%s" % (port, new_key, value))
bfd_lconf_default = {'bfd_config_local:bfd_dst_ip': '169.254.1.0',
'bfd_config_local:bfd_dst_mac':
'00:23:20:00:00:01'}
- for key, value in bfd_lconf_default.iteritems():
+ for key, value in six.iteritems(bfd_lconf_default):
vtep_ctl("set tunnel %s %s=%s" % (tunnel, key, value))
# bfd_config_remote options from VTEP DB should be populated to
handle_physical()
- for ls_name, ls in Lswitches.items():
+ for ls_name, ls in six.iteritems(Lswitches):
ls.run()
run_bfd()