Bug fix.
authorSapan Bhatia <sapanb@cs.princeton.edu>
Fri, 11 Sep 2009 16:08:42 +0000 (16:08 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Fri, 11 Sep 2009 16:08:42 +0000 (16:08 +0000)
sfatables/commands/Add.py

index 36b22c3..4f0e606 100644 (file)
@@ -14,11 +14,11 @@ class Add(Command):
 
     def getnextfilename(self,type,chain):
         dir = sfatables_config + "/"+chain;
-        last_rule_number = 1
+        last_rule_number = 0
 
         for (root, dirs, files) in os.walk(dir):
             for file in files:
-                if (file.startswith('sfatables-')):
+                if (file.startswith('sfatables-') and file.endswith(type)):
                     number_str = file.split('-')[1]
                     number = int(number_str)
                     if (number>last_rule_number):