diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-01-19 00:12:03 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2025-01-19 00:17:12 +0100 |
| commit | 20f0deb28d3d88537171f869234520ceb4f67f01 (patch) | |
| tree | c4ba36e2e5295ec8f158814cef88ea3fb6804180 /python/vyos/configquery.py | |
| parent | e455ac5909456328f62000fa054de2ad7700ff39 (diff) | |
| download | veeos-1x-20f0deb28d3d88537171f869234520ceb4f67f01.tar.gz veeos-1x-20f0deb28d3d88537171f869234520ceb4f67f01.zip | |
wireguard: T4930: use get_config_dict() rather then individual config queries
Extend ConfigTreeQuery().get_config_dict() with arguments to read in default
CLI values, too. This removes the need for hardcoded default values at
multiple places like:
if max_dns_retry is None:
max_dns_retry = 3
in this case.
Diffstat (limited to 'python/vyos/configquery.py')
| -rw-r--r-- | python/vyos/configquery.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/vyos/configquery.py b/python/vyos/configquery.py index 5d6ca9be9..4c4ead0a3 100644 --- a/python/vyos/configquery.py +++ b/python/vyos/configquery.py @@ -1,4 +1,4 @@ -# Copyright 2021-2024 VyOS maintainers and contributors <maintainers@vyos.io> +# Copyright 2021-2025 VyOS maintainers and contributors <maintainers@vyos.io> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -120,11 +120,14 @@ class ConfigTreeQuery(GenericConfigQuery): def get_config_dict(self, path=[], effective=False, key_mangling=None, get_first_key=False, no_multi_convert=False, - no_tag_node_value_mangle=False): + no_tag_node_value_mangle=False, with_defaults=False, + with_recursive_defaults=False): return self.config.get_config_dict(path, effective=effective, key_mangling=key_mangling, get_first_key=get_first_key, no_multi_convert=no_multi_convert, - no_tag_node_value_mangle=no_tag_node_value_mangle) + no_tag_node_value_mangle=no_tag_node_value_mangle, + with_defaults=with_defaults, + with_recursive_defaults=with_recursive_defaults) class VbashOpRun(GenericOpRun): def __init__(self): |
