if parsed_args.threshold:
childargs.extend(['--threshold', parsed_args.threshold])
ret, outbuf, outs = send_command(target, childargs, inbuf)
- # combine nonerror outbuf and outs; either may have cmd output
- if ret == 0:
- # old tool always added a newline
- outbuf = outs + '\n' + outbuf
- # clear outs so generic code below doesn't print it to stderr
- outs = ''
elif ret:
if ret < 0:
ret = -ret
# this assumes outs never has useful command output, only status
if outs:
- print >> sys.stderr, prefix, outs
+ if compat and ret == 0:
+ # old cli/mon would send status string to stdout on non-error
+ print outs
+ else:
+ print >> sys.stderr, prefix, outs
if (parsed_args.output_file):
outf.write(outbuf)