diff options
Diffstat (limited to 'python')
-rwxr-xr-x[-rw-r--r--] | python/vyos/template.py | 3 | ||||
-rw-r--r-- | python/vyos/utils/file.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index a4fff649c..2a99eef9d 100644..100755 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -692,7 +692,8 @@ def conntrack_rule(rule_conf, rule_id, action, ipv6=False): else: for protocol, protocol_config in rule_conf['protocol'].items(): proto = protocol - output.append(f'meta l4proto {proto}') + if proto != 'all': + output.append(f'meta l4proto {proto}') tcp_flags = dict_search_args(rule_conf, 'tcp', 'flags') if tcp_flags and action != 'timeout': diff --git a/python/vyos/utils/file.py b/python/vyos/utils/file.py index 0818f1b81..e16d5b40d 100644 --- a/python/vyos/utils/file.py +++ b/python/vyos/utils/file.py @@ -51,7 +51,7 @@ def write_file(fname, data, defaultonfailure=None, user=None, group=None, mode=N If directory of file is not present, it is auto-created. """ dirname = os.path.dirname(fname) - if not os.path.isdir(dirname): + if dirname and not os.path.isdir(dirname): os.makedirs(dirname, mode=0o755, exist_ok=False) chown(dirname, user, group) |