return "sfatables-%d-%s"%(last_rule_number+1,type)
def call_gen(self, chain, type, dir, options):
return "sfatables-%d-%s"%(last_rule_number+1,type)
def call_gen(self, chain, type, dir, options):
xmldoc = libxml2.parseFile(filename)
p = xmldoc.xpathNewContext()
supplied_arguments = options.arguments
xmldoc = libxml2.parseFile(filename)
p = xmldoc.xpathNewContext()
supplied_arguments = options.arguments
for option in supplied_arguments:
option_name = option['name']
option_value = getattr(options,option_name)
if (hasattr(options,option_name)):
for option in supplied_arguments:
option_name = option['name']
option_value = getattr(options,option_name)
if (hasattr(options,option_name)):
context[0].addChild(valueNode)
filename = self.getnextfilename(type,chain)
context[0].addChild(valueNode)
filename = self.getnextfilename(type,chain)
- file_path = sfatables_config + '/' + chain + '/' + filename
+ file_path = os.path.join(sfatables_config, chain, filename)
+ if not os.path.isdir(os.path.dirname(file_path)):
+ os.makedirs(os.path.dirname(file_path))