From efb1a1c88f436a3704c4ca6e15b65aeded4b9654 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 20 Jun 2019 22:14:36 +0200 Subject: firewall: T1461: deleting 'firewall options' causes Python TypeError [ firewall options interface wg01 ] Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/firewall_options.py", line 139, in apply(c) File "/usr/libexec/vyos/conf_mode/firewall_options.py", line 97, in apply if tcp['new_chain4']: TypeError: 'NoneType' object is not subscriptable delete [ firewall options ] failed delete [ firewall ] failed Commit failed --- src/conf_mode/firewall_options.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf_mode/firewall_options.py b/src/conf_mode/firewall_options.py index e2c306904..2be80cdbf 100755 --- a/src/conf_mode/firewall_options.py +++ b/src/conf_mode/firewall_options.py @@ -32,7 +32,8 @@ def get_config(): opts = copy.deepcopy(default_config_data) conf = Config() if not conf.exists('firewall options'): - return None + # bail out early + return opts else: conf.set_level('firewall options') -- cgit v1.2.3