cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seb...@apache.org
Subject [1/2] git commit: updated refs/heads/4.3 to 9289158
Date Tue, 17 Jun 2014 15:10:50 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 07602d81a -> 928915840


CLOUDSTACK-6927: less code


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/199bc08a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/199bc08a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/199bc08a

Branch: refs/heads/4.3
Commit: 199bc08a3f6b776d3fdbe59dca29ad41fc0beb96
Parents: 07602d8
Author: Loic Lambiel <lll@exoscale.ch>
Authored: Wed Jun 4 16:45:07 2014 +0200
Committer: Sebastien Goasguen <runseb@gmail.com>
Committed: Tue Jun 17 17:09:21 2014 +0200

----------------------------------------------------------------------
 scripts/vm/network/security_group.py | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/199bc08a/scripts/vm/network/security_group.py
----------------------------------------------------------------------
diff --git a/scripts/vm/network/security_group.py b/scripts/vm/network/security_group.py
index f80c9e4..be61842 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -547,7 +547,7 @@ def delete_rules_for_vm_in_bridge_firewall_chain(vmName):
     delcmds = execute(delcmd).split('\n')
     delcmds.pop()
     for cmd in delcmds:
-        if cmd == '':
+        if cmd == "":
             continue
         try:
             execute("iptables " + cmd)
@@ -689,15 +689,14 @@ def cleanup_rules():
         chains = execute(chainscmd).split('\n')
         cleanup = []
         for chain in chains:
-            if chain == '':
+            if chain == "":
                 continue
-            elif chain.startswith(':'):
+            elif chain.startswith(":"):
                 chain = chain[1:]
-            if chain.endswith('-eg'):
+            if chain.endswith("-eg"):
                 chain = chain[:-3]
-            elif chain.endswith('-def'):
-                chain = chain[:-3]
-                chain = chain + 'VM'
+            elif chain.endswith("-def"):
+                chain = chain[:-3] + "VM"
 
             vm_name = chain
 
@@ -714,13 +713,12 @@ def cleanup_rules():
         chainscmd = """ebtables-save | awk '{for(i=1;i<=NF;i++){ if($i ~ /[i|r|s|v]-[0-9]/){print
$i} } }'"""
         chains = execute(chainscmd).split('\n')
         for chain in chains:
-            if chain == '':
+            if chain == "":
                 continue
-            elif chain.startswith(':'):
+            elif chain.startswith(":"):
                 chain = chain[1:]
-            if not chain.endswith('VM'):
-                chain = chain.split('VM')
-                chain = chain[0] + 'VM'
+            if not chain.endswith("VM"):
+                chain = chain.split("VM")[0] + "VM"
 
                 vm_name = chain
 


Mime
View raw message