Beispiel #1
0
    def __init__(self, table, name, rules, ipv6, logger):
        Transaction.__init__(self)
        Logger.__init__(self, table, parent=logger)
        self.rules = rules
        self.ipv6 = ipv6
        self.name = name

        filename = '%s-localfw_%s.rules' % (table, self.name)
        if self.ipv6:
            self.filename = path_join(LOCAL_RULES_IPV6_DIR, filename)
        else:
            self.filename = path_join(LOCAL_RULES_IPV4_DIR, filename)
        self.old_filename = None
        self.new_filename = None
Beispiel #2
0
 def __init__(self, new_ruleset):
     Transaction.__init__(self)
     self.filename = PRODUCTION_RULESET
     self.new_ruleset = new_ruleset
     self.old_production = File(self.filename + ".old", False)
Beispiel #3
0
 def __init__(self, name, use_nufw):
     Transaction.__init__(self)
     self.new_ruleset = {'timestamp': datetime.now(), 'ruleset': name, 'use_nufw': use_nufw}
     self.filename = STORAGE_FILENAME