Skip to content

Commit

Permalink
ui: fixed setting daemon default action
Browse files Browse the repository at this point in the history
Reject option was not being taken into account.

Closes #1017
  • Loading branch information
gustavo-iniguez-goya committed Aug 16, 2023
1 parent 57838e8 commit eb89a90
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ui/opensnitch/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,12 @@ def _overwrite_nodes_config(self, node_config):
_default_action = self._cfg.getInt(self._cfg.DEFAULT_ACTION_KEY)
try:
temp_cfg = json.loads(newconf.config)
if _default_action == Config.ACTION_DENY_IDX:
temp_cfg['DefaultAction'] = Config.ACTION_DENY
else:
if _default_action == Config.ACTION_ALLOW_IDX:
temp_cfg['DefaultAction'] = Config.ACTION_ALLOW
else:
temp_cfg['DefaultAction'] = Config.ACTION_DENY

print("Setting daemon DefaultAction to:", temp_cfg['DefaultAction'])

newconf.config = json.dumps(temp_cfg)
except Exception as e:
Expand Down

0 comments on commit eb89a90

Please sign in to comment.