Bug fix.
authorSapan Bhatia <sapanb@cs.princeton.edu>
Tue, 15 Sep 2009 14:37:28 +0000 (14:37 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Tue, 15 Sep 2009 14:37:28 +0000 (14:37 +0000)
sfatables/command.py
sfatables/exec.py
sfatables/xmlextension.py

index 825c9f2..1cb58e7 100644 (file)
@@ -9,6 +9,13 @@ class Command:
     action = 'store_const'
 
     def __init__(self):
+        self.options = []
+        self.help = ''
+        self.type = 'command'
+        self.matches = False
+        self.targets = False
+        self.action = 'store_const'
+
         return
 
     def call(self, coptions, moptions, toptions):
index ef0933d..778d73d 100644 (file)
@@ -13,9 +13,8 @@ from sfatables.commands.List import *
 from sfatables.xmlrule import *
 
 class SFATablesRules:
-    sorted_rule_list = []
-
     def __init__(self, chain_name):
+        self.sorted_rule_list = []
         chain_dir_path = "%s/%s"%(sfatables_config,chain_name)
         rule_list = List().get_rule_list(chain_dir_path)
         for rule_number in rule_list:
index 77219eb..4fc1ab5 100644 (file)
@@ -8,13 +8,13 @@ import libxml2
 from sfatables.globals import *
 
 class Xmlextension:
-    context = ""
-    processor = ""
-    operand = "VALUE"
-    arguments = []
-    terminal = 0 
-
     def __init__(self, dir, component_name):
+        self.context = ""
+        self.processor = ""
+        self.operand = "VALUE"
+        self.arguments = []
+        self.terminal = 0
+
         filename = dir+"/"+component_name+".xml"
         self.xmldoc = libxml2.parseFile(filename)