mirror of https://github.com/apache/cloudstack.git
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.
This commit is contained in:
parent
cc27095554
commit
3114907861
|
|
@ -149,7 +149,7 @@ def split_ips_by_family(ips):
|
|||
|
||||
|
||||
def get_bridge_physdev(brname):
|
||||
physdev = execute("bridge -o link show | awk '/master %s / && !/^[0-9]+: vnet/ {print $2}'" % brname)
|
||||
physdev = execute("bridge -o link show | awk '/master %s / && !/^[0-9]+: vnet/ {print $2}' | head -1" % brname)
|
||||
return physdev.strip()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue