diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-03-31 14:28:37 -0500 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-04-08 09:29:42 -0500 |
| commit | 1e5077c8f5ac28eade4d2ad8898ed8bd3f79edc7 (patch) | |
| tree | 4c3b4f5002626c0ee331be234f89467c5fcd5953 /python/vyos/config.py | |
| parent | ada2cac0324dd3fa668b9af58f119b8a64b4e9e1 (diff) | |
| download | veeos-1x-1e5077c8f5ac28eade4d2ad8898ed8bd3f79edc7.tar.gz veeos-1x-1e5077c8f5ac28eade4d2ad8898ed8bd3f79edc7.zip | |
T7302: implement commit dry-run for vyconfd/commitd
Diffstat (limited to 'python/vyos/config.py')
| -rw-r--r-- | python/vyos/config.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py index 1fab46761..546eeceab 100644 --- a/python/vyos/config.py +++ b/python/vyos/config.py @@ -149,6 +149,18 @@ class Config(object): return self._running_config return self._session_config + def get_bool_attr(self, attr) -> bool: + if not hasattr(self, attr): + return False + else: + tmp = getattr(self, attr) + if not isinstance(tmp, bool): + return False + return tmp + + def set_bool_attr(self, attr, val): + setattr(self, attr, val) + def _make_path(self, path): # Backwards-compatibility stuff: original implementation used string paths # libvyosconfig paths are lists, but since node names cannot contain whitespace, |
