Skip to content

Commit ef2acbb

Browse files
Rene Diepstratenshwstppr
authored andcommitted
security_group: Add head -1 to get_bridge_physdev (#3648)
We've encountered a corner case where bridge -o link show returned two lines per bridge instead of one. get_bridge_physdev in security_group.py returned bond0.701\nbond0.701. Although this may very well be something on the hypervisor, we should limit the lines returned. I therefore added a mere | head -1 to the function.
1 parent 848860d commit ef2acbb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/vm/network/security_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def split_ips_by_family(ips):
147147

148148

149149
def get_bridge_physdev(brname):
150-
physdev = execute("bridge -o link show | awk '/master %s / && !/^[0-9]+: vnet/ {print $2}'" % brname)
150+
physdev = execute("bridge -o link show | awk '/master %s / && !/^[0-9]+: vnet/ {print $2}' | head -1" % brname)
151151
return physdev.strip()
152152

153153

0 commit comments

Comments
 (0)