tests: Strip trailing space from ip output
It seems that the messages from ip may have a trailing space in some cases, which may break matching in surrounding logic. Strip the output to remove whitespace and avoid any issues this may cause. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
This commit is contained in:
parent
2112f0572f
commit
77f0b40872
1 changed files with 1 additions and 1 deletions
|
@ -4766,7 +4766,7 @@ def get_permanent_neighbors(ifname):
|
||||||
cmd = subprocess.Popen(['ip', 'nei'], stdout=subprocess.PIPE)
|
cmd = subprocess.Popen(['ip', 'nei'], stdout=subprocess.PIPE)
|
||||||
res = cmd.stdout.read().decode()
|
res = cmd.stdout.read().decode()
|
||||||
cmd.stdout.close()
|
cmd.stdout.close()
|
||||||
return [line for line in res.splitlines() if "PERMANENT" in line and ifname in line]
|
return [line.strip() for line in res.splitlines() if "PERMANENT" in line and ifname in line]
|
||||||
|
|
||||||
def get_bridge_macs(ifname):
|
def get_bridge_macs(ifname):
|
||||||
cmd = subprocess.Popen(['brctl', 'showmacs', ifname],
|
cmd = subprocess.Popen(['brctl', 'showmacs', ifname],
|
||||||
|
|
Loading…
Reference in a new issue