Antoni Segura Puimedon has uploaded a new change for review.
Change subject: sourcerouting: fix _getRoute not to include local routes
......................................................................
sourcerouting: fix _getRoute not to include local routes
_getRoute, a method used to find the routes of a vdsm created table
in Dynamic Source Routing was listing the routes of the table and
matching by device, the problem is that such matching would wrongly
include local scope routes. Having such route would generate an
IPRoute2 exception when removing routes and rules would never be
removed, thus leaving behind trash in the rule list.
Change-Id: I5b3d43c8a2077e40b8b4314f02ea17bc3968c42b
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/network/sourceroute.py
1 file changed, 2 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/27262/1
diff --git a/vdsm/network/sourceroute.py b/vdsm/network/sourceroute.py
index 17773a3..5e3fb5e 100644
--- a/vdsm/network/sourceroute.py
+++ b/vdsm/network/sourceroute.py
@@ -112,20 +112,14 @@
@staticmethod
def _getRoutes(table, device):
routes = []
- for entry in routeShowTable(table):
+ for entry in routeShowTable('all'):
try:
route = Route.fromText(entry)
except ValueError:
logging.debug("Could not parse route %s" % entry)
else:
- if route.device == device:
- """
- When displaying routes from a table, the table is omitted,
- so add it back again
- """
- route.table = table
+ if route.table == table:
routes.append(route)
-
return routes
@staticmethod
--
To view, visit
http://gerrit.ovirt.org/27262
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b3d43c8a2077e40b8b4314f02ea17bc3968c42b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>