Commit 5f177e1f authored by Alain Takoudjou's avatar Alain Takoudjou

partition can request to update ip route of tap interface

parent 36d19481
......@@ -840,8 +840,10 @@ class Tap(object):
if self.ipv4_addr:
# Check if this route exits
code, result = callAndRead(['ip', 'route', 'show', self.ipv4_addr])
if code == 0 and self.ipv4_addr in result and self.name in result:
if self.ipv4_addr in result:
# Skip already configured route
return
code, result = callAndRead(['ip', 'route', 'show'])
callAndRead(['route', 'add', '-host', self.ipv4_addr, 'dev', self.name])
else:
raise ValueError("%s should not be empty. No ipv4 address assigned to %s" %
......
This diff is collapsed.
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