summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-01-28 07:51:56 +0100
committerGitHub <noreply@github.com>2023-01-28 07:51:56 +0100
commit248d4eda9304c34aaa9b2a8cd7a2b1c0bbbf91fe (patch)
tree585ecef1003abe5e4bb4cdca0e5c0e6b706da62c
parente6023a3c710a84c12f9ce51d41af21120bb44e5a (diff)
parentdcfde8d749ea38216a45dcc4072a378eb0d02f45 (diff)
downloadvyos-1x-248d4eda9304c34aaa9b2a8cd7a2b1c0bbbf91fe.tar.gz
vyos-1x-248d4eda9304c34aaa9b2a8cd7a2b1c0bbbf91fe.zip
Merge pull request #1789 from jestabro/insert_error
configtree: T4961: improve error reporting of function copy
-rw-r--r--python/vyos/configtree.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/vyos/configtree.py b/python/vyos/configtree.py
index b88615513..f2358ee4f 100644
--- a/python/vyos/configtree.py
+++ b/python/vyos/configtree.py
@@ -242,7 +242,8 @@ class ConfigTree(object):
raise ConfigTreeError()
res = self.__copy(self.__config, oldpath_str, newpath_str)
if (res != 0):
- raise ConfigTreeError("Path [{}] doesn't exist".format(old_path))
+ msg = self.__get_error().decode()
+ raise ConfigTreeError(msg)
if self.__migration:
print(f"- op: copy old_path: {old_path} new_path: {new_path}")