DaanHoogland closed pull request #2732: security_group: Use execute() function 
instead of non-existing bash()
URL: https://github.com/apache/cloudstack/pull/2732
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/scripts/vm/network/security_group.py 
b/scripts/vm/network/security_group.py
index 13d31f4ee3f..0471dbea2a3 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -61,7 +61,7 @@ def execute(cmd):
     try:
         return check_output(cmd, shell=True)
     except CalledProcessError as e:
-        logging.exception('Failed to execute: %s', e.cmd)
+        pass
 
 
 def can_bridge_firewall(privnic):
@@ -1151,8 +1151,8 @@ def getvmId(vmName):
 
 def getBrfw(brname):
     cmd = "iptables-save |grep physdev-is-bridged |grep FORWARD |grep BF |grep 
'\-o' | grep -w " + brname  + "|awk '{print $9}' | head -1"
-    brfwname = bash("-c", cmd).stdout.strip()
-    if brfwname == "":
+    brfwname = execute(cmd).strip()
+    if not brfwname:
         brfwname = "BF-" + brname
     return brfwname
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to