This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.13
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.13 by this push:
     new 6e7516c  kvm: Fix get_bridge_physdev where it returns "device:" 
instead of just "device" (#4740)
6e7516c is described below

commit 6e7516c48a01e8664ce4a0c6f98a36cbcc42cf71
Author: Gabriel Beims Bräscher <[email protected]>
AuthorDate: Thu Mar 4 06:19:24 2021 -0300

    kvm: Fix get_bridge_physdev where it returns "device:" instead of just 
"device" (#4740)
    
    When running get_bridge_physdev(brname) from security_group.py it is 
returned the bridge device as brname: instead of the expected brname.
    
    We experienced this issue on CloudStack 4.13.1.0 with Security Groups 
enabled for Advanced Networking. Additionally, KVM nodes are running on Ubuntu 
18.04.
    
    PR #4303 (merged in 4.15) added support for Ubuntu 20.04 which turned out 
to fix get_bridge_physdev(brname); however, we faced the very same issue with 
the previous CloudStack and Ubuntu versions.
    
    Even though we might not get a 4.13.2, and CloudStack 4.14.1.0 has just 
been released, this PR proposes merging the fix into branch 4.13 and then get 
it forwarded into 4.14. Thus, allowing users to have this fix referenced and 
also opening the possibility of addressing this in case of a potential 4.14.2.0.
---
 scripts/vm/network/security_group.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/vm/network/security_group.py 
b/scripts/vm/network/security_group.py
index 1cb4a84..21f6f7e 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -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}' | head -1" % brname)
+    physdev = execute("bridge -o link show | awk '/master %s / && !/^[0-9]+: 
vnet/ {print $2}' | head -1 | cut -d ':' -f1" % brname)
     return physdev.strip()
 
 

Reply via email to