The script afm-util wasn't reporting correctly
errors. The use of the output status of
afb-client-demo was possible but this solution
is simplest to output the error message.
Bug-AGL: SPEC-1863
Change-Id: I5ac919e615ed5c0f21589292e94a9c3d6209a83f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
send() {
afb-client-demo -H -d unix:@afm_platform_rundir@/apis/ws/afm-main "$1" "$2" |
send() {
afb-client-demo -H -d unix:@afm_platform_rundir@/apis/ws/afm-main "$1" "$2" |
- awk '$1=="ON-REPLY-FAIL"{$1="ERROR:";$2="";print;exit 1;}NR>1'
+ awk '$1=="ON-REPLY" && $3!="success"{$1="ERROR:";$2="";print > "/dev/stderr";exit 1;}NR>1'