Commit 87c3dbb0 authored by David Johnson's avatar David Johnson

Work around broken pyroute2 flush_routes for seg6 encap.

pyroute2 doesn't like routes with encap mode in them, it seems, so
its get_routes | route('del') pipeline doesn't work.

So when removing actions, first remove our route manually, then
flush the table to be sure.
parent f969496b
Pipeline #3032 passed with stages
in 15 seconds
......@@ -365,9 +365,16 @@ class Engine(object):
% (str(number),))
# Try to remove from netlink:
try:
args = action.to_nl()
LOG.debug("iproute.route del: %s" % (str(args)))
self.iproute.route(
'del',table=action.number+self.action_min,**args)
LOG.debug("flushing table %s"
% (str(self.action_min+action.number)))
self.iproute.flush_routes(table=self.action_min+action.number)
except:
e = sys.exc_info()[1]
LOG.exception(e)
raise Exception("failed to remove action: %s" % (str(e)))
del self.db["action"][numstr]
if number < self.db["idtable"]["action"]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment