From 984353232f21c1a8f3326b6841db28f5108b6671 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 16:15:07 +0530 Subject: [PATCH 1/2] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index 9427ba7..3ecc0e4 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -420,6 +420,7 @@ def exists( % (element, x_path, count_pass, count_fail) ) self._print_result(msg, res) + tresult['err'] = err_mssg elif res is True: msg = 'All "%s" exists at xpath "%s" [ %d value matched ]' % ( element, @@ -427,6 +428,7 @@ def exists( count_pass, ) self._print_result(msg, res) + tresult['info'] = info_mssg # tresult['info'] = info_mssg # tresult['err'] = err_mssg From 31bc918192943c788f980e947eedd5e6f2628414 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Wed, 12 Jun 2024 10:22:03 +0530 Subject: [PATCH 2/2] Fix for issue#327 --- tools/jsnap2py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/jsnap2py b/tools/jsnap2py index 8baa9ba..860a6fd 100755 --- a/tools/jsnap2py +++ b/tools/jsnap2py @@ -27,7 +27,7 @@ def msg_change(x): data = (data[0],data[1][1:]) if data[0] in ['id', 'ID']: data = (data[0], int(data[1])-1) - msg = "{{%s_%s}}" % (data) + msg = "{{%s_%s}}" % (data) elif data[0] in ['PRE', 'POST']: msg = '{{%s["%s"]}}' % (data) else: @@ -120,7 +120,7 @@ else: '\$id\.\d|\$pre\s?/?\.?/\s?[\w-]+/?[\w-]*|\$post\s?/?\.?/\s?[\w-]+/?[\w-]*|,\s?\.{0,2}/?\.{0,2}/?[\w-]+/?[\w-]*/?[\w-]*', data.group(2), re.I) - inputs = map(msg_change, inputs) + inputs = list(map(msg_change, inputs)) to_format = re.search('"(.*?)"', obj.group(2)) if len(inputs) > 0: if to_format: