print >> sys.stderr, \
'error handling command target: {0}'.format(e)
return 1, '', ''
+ if len(cmdargs) and cmdargs[0] == 'tell':
+ print >> sys.stderr, \
+ 'Can not use \'tell\' in interactive mode.'
+ continue
valid_dict = validate_command(sigdict, cmdargs, verbose)
if valid_dict:
if parsed_args.output_format:
if ret:
ret = abs(ret)
print >> sys.stderr, \
- 'Error: {0} {1}'.format(ret, errno.errorcode[ret])
+ 'Error: {0} {1}'.format(ret, errno.errorcode.get(ret, 'Unknown'))
if outbuf:
print outbuf
if outs:
if len(childargs) >= 2 and \
childargs[0] in ['mon', 'osd'] and \
childargs[1] == 'tell':
- print >> sys.stderr, '"{0} tell" is deprecated; try "tell {0}.<id>" instead (id can be "*") '.format(childargs[0])
+ print >> sys.stderr, '"{0} tell" is deprecated; try "tell {0}.<id> <command> [options...]" instead (id can be "*") '.format(childargs[0])
return 1
if parsed_args.help:
childargs = injectargs
if not len(childargs):
print >> sys.stderr, \
- 'Cannot use \'tell\' with interactive mode'
+ '"{0} tell" requires additional arguments.'.format(sys.argv[0]), \
+ 'Try "{0} tell <name> <command> [options...]" instead.'.format(sys.argv[0])
return errno.EINVAL
# fetch JSON sigs from command
sigdict, inbuf, verbose)
if ret < 0:
ret = -ret
- print >> sys.stderr, prefix + 'Second attempt of previously successful command failed with {0}: {1}'.format(errno.errorcode[ret], outs)
+ print >> sys.stderr, prefix + 'Second attempt of previously successful command failed with {0}: {1}'.format(errno.errorcode.get(ret, 'Unknown'), outs)
if ret < 0:
ret = -ret
- print >> sys.stderr, prefix + 'Error {0}: {1}'.format(errno.errorcode[ret], outs)
+ print >> sys.stderr, prefix + 'Error {0}: {1}'.format(errno.errorcode.get(ret, 'Unknown'), outs)
if len(targets) > 1:
final_ret = ret
else: