It turns out that this is a compound bug with two code errors. The first is the command-line parameters being passed as a string instead of a pointer to the args. The second is an incorrect filename in checking existing routes. This code:
for interface in apply_routes: logger.debug('Applying routes for interface %s' % interface[0]) commands = self.iproute2_route_commands(interface[0], interface[1])
is passing an interface name where it should be passing a filename. Here is the corrected code:
for interface in apply_routes: logger.debug('Applying routes for interface %s' % interface[0]) filename = self.root_dir + route_config_path(interface[1]) commands = self.iproute2_route_commands(interface[0], filename)
It turns out that this is a compound bug with two code errors. The first is the command-line parameters being passed as a string instead of a pointer to the args. The second is an incorrect filename in checking existing routes. This code:
for interface in apply_routes:
logger. debug(' Applying routes for interface %s' % interface[0])
commands = self.iproute2_ route_commands( interface[ 0], interface[1])
is passing an interface name where it should be passing a filename. Here is the corrected code:
for interface in apply_routes:
logger. debug(' Applying routes for interface %s' % interface[0])
filename = self.root_dir + route_config_ path(interface[ 1])
commands = self.iproute2_ route_commands( interface[ 0], filename)