[CI FIX] Fix 'ip route' matching multiple subnets

Existing 'ip route list proto kernel match <subnet>' may match
subnets different than the one specified when specific CI
nodes are selected to run CI job. This patch changes the command
to prevent unrelated subnets from being listed.

Change-Id: I62da6f14eb53c6d3c74442a626b7ea0fd37a7cad
Closes-bug: #1617417
This commit is contained in:
Rodrigo Barbieri 2016-08-26 15:18:02 -03:00
parent 614418a2e4
commit bfff3a7b8d
1 changed files with 2 additions and 2 deletions

View File

@ -349,8 +349,8 @@ class IpRouteCommand(IpDeviceCommandBase):
subnet = device_route_line.split()[0]
except Exception:
continue
subnet_route_list_lines = self._run('list', 'proto', 'kernel',
'match', subnet).split('\n')
subnet_route_list_lines = self._run(
'list', 'proto', 'kernel', 'exact', subnet).split('\n')
for subnet_route_line in subnet_route_list_lines:
i = iter(subnet_route_line.split())
while(next(i) != 'dev'):