Skip to content

Commit

Permalink
python3: use "foo in dict" not dict.has_key(foo)
Browse files Browse the repository at this point in the history
has_key() was removed in python3.
  • Loading branch information
erig0 committed Jan 30, 2018
1 parent ee5874f commit f837ab2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/firewall/core/ebtables.py
Expand Up @@ -244,7 +244,7 @@ def apply_default_rules(self, transaction, log_denied="off"):
if table not in self.available_tables():
continue
default_rules = DEFAULT_RULES[table][:]
if log_denied != "off" and LOG_RULES.has_key(table):
if log_denied != "off" and table in LOG_RULES:
default_rules.extend(LOG_RULES[table])
prefix = [ "-t", table ]
for rule in DEFAULT_RULES[table]:
Expand Down
2 changes: 1 addition & 1 deletion src/firewall/core/ipXtables.py
Expand Up @@ -458,7 +458,7 @@ def apply_default_rules(self, transaction, log_denied="off"):
if table not in self.available_tables():
continue
default_rules = DEFAULT_RULES[table][:]
if log_denied != "off" and LOG_RULES.has_key(table):
if log_denied != "off" and table in LOG_RULES:
default_rules.extend(LOG_RULES[table])
prefix = [ "-t", table ]
for rule in DEFAULT_RULES[table]:
Expand Down

0 comments on commit f837ab2

Please sign in to comment.