diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-05-07 00:50:44 +0100 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-05-07 00:50:44 +0100 |
commit | 367094ff1764116089c9359e1e949db781a4a0da (patch) | |
tree | cf3135162c8a57af652f027805d1d4a9d63cbca0 /python/vyos/config.py | |
parent | e9516e73796bbbda1be76e3f8b5d83cd84070830 (diff) | |
parent | ed22334321d3b6f27b5d695a4f984257b909f78b (diff) | |
download | vyos-1x-367094ff1764116089c9359e1e949db781a4a0da.tar.gz vyos-1x-367094ff1764116089c9359e1e949db781a4a0da.zip |
debug: T1230: add time information to saved debug logs
Diffstat (limited to 'python/vyos/config.py')
-rw-r--r-- | python/vyos/config.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py index 75055a603..0bc6be12a 100644 --- a/python/vyos/config.py +++ b/python/vyos/config.py @@ -155,7 +155,7 @@ class Config(object): ``exists("system name-server"`` without ``set_level``. Args: - path (str): relative config path + path (str|list): relative config path """ # Make sure there's always a space between default path (level) # and path supplied as method argument @@ -166,7 +166,7 @@ class Config(object): else: self._level = [] elif isinstance(path, list): - self._level = path + self._level = path.copy() else: raise TypeError("Level path must be either a whitespace-separated string or a list") @@ -177,7 +177,7 @@ class Config(object): Returns: str: current edit level """ - return(self._level) + return(self._level.copy()) def exists(self, path): """ @@ -386,7 +386,7 @@ class Config(object): values = [] if not values: - return(default) + return(default.copy()) else: return(values) @@ -407,7 +407,7 @@ class Config(object): nodes = [] if not nodes: - return(default) + return(default.copy()) else: return(nodes) @@ -448,7 +448,6 @@ class Config(object): else: return(value) - def return_effective_values(self, path, default=[]): """ Retrieve all values of a multi-value node in a running (effective) config @@ -465,7 +464,7 @@ class Config(object): values = [] if not values: - return(default) + return(default.copy()) else: return(values) @@ -488,6 +487,6 @@ class Config(object): nodes = [] if not nodes: - return(default) + return(default.copy()) else: return(nodes) |