From dcfde8d749ea38216a45dcc4072a378eb0d02f45 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Fri, 27 Jan 2023 11:14:29 -0600 Subject: configtree: T4961: improve error reporting of copy --- python/vyos/configtree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python/vyos/configtree.py') 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}") -- cgit v1.2.3