TT#139455 Improve patchtt error for missing tt2 template

The previous error message was confusing:
> root@web01a:~# ngcpcfg patch
> 2021-10-20 14:21:29 web01a: Validating patch '/etc/ngcp-config/templates/etc/kamailio/lb_A/proxy/kamailio.conf.patchtt.tt2'
> 2021-10-20 14:21:29 web01a: Error: Missing template for patch '/etc/ngcp-config/templates/etc/kamailio/lb_A/proxy/kamailio.conf.patchtt.tt2'
> 2021-10-20 14:21:29 web01a: Error: Some operations above finished with an error for the file(s):
> 	/etc/ngcp-config/templates/etc/kamailio/lb_A/proxy/kamailio.conf.patchtt.tt2
> root@web01a:~#

The new version is:
> root@web01a:~# ngcpcfg patch
> 2021-10-20 14:26:45 web01a: Validating patch '/etc/ngcp-config/templates/etc/kamailio/lb_A/proxy/kamailio.conf.patchtt.tt2'
> 2021-10-20 14:26:45 web01a: Error: Missing template '/etc/ngcp-config/templates/etc/kamailio/lb_A/proxy/kamailio.conf.tt2'
> 2021-10-20 14:26:45 web01a: Error:        for patch '/etc/ngcp-config/templates/etc/kamailio/lb_A/proxy/kamailio.conf.patchtt.tt2'
> 2021-10-20 14:26:45 web01a: Error: Some operations above finished with an error for the file(s):
> 	/etc/ngcp-config/templates/etc/kamailio/lb_A/proxy/kamailio.conf.patchtt.tt2
> root@web01a:~#

Change-Id: I8979dc9dc545f8129ec69de71eef8cceab5fc337
mr10.2
Alexander Lutay 4 years ago committed by Victor Seva
parent 01bbe14e9e
commit d550799c1c

@ -94,7 +94,8 @@ patch_validate_patch() {
if [ -f "${template}" ] ; then
log_debug "Found template for the patch: '${template}'"
else
log_error "Missing template for patch '${patch}'"
log_error "Missing template '${template}'"
log_error " for patch '${patch}'"
bad_files+=("${patch}")
return 1
fi

@ -165,8 +165,8 @@ def test_patch_action_template_missing_for_patchtt(ngcpcfgcli, tmpdir):
assert "Validating patch '" + str(template_path) + \
"/apt/apt.conf.d/71_no_recommended.patchtt.tt2'" in out.stdout
assert "Error: Missing template for patch '" + str(template_path) + \
"/apt/apt.conf.d/71_no_recommended.patchtt.tt2'" in out.stderr
assert "Error: Missing template '" + str(template_path) + \
"/apt/apt.conf.d/71_no_recommended.tt2'" in out.stderr
assert "Error: Some operations above finished with an error for the file(s)" in out.stderr
assert 'Requested patchtt operation has finished successfully.' not in out.stdout

Loading…
Cancel
Save