summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-16 16:49:47 -0700
committerSage Weil <sage@inktank.com>2013-06-16 16:49:47 -0700
commite3fb095d8aa88556e4356c76b848fa61b09acbc0 (patch)
tree5f63568d205dfbdf8aae93c14f8b0b2c9c63a6f6
parent80c2d5a8db0900e727275810ac8d160ababb82ae (diff)
parent2fe4d29f4de567483b28b880ad90fa9f189f9c13 (diff)
downloadceph-e3fb095d8aa88556e4356c76b848fa61b09acbc0.tar.gz
Merge branch 'next'
-rwxr-xr-xsrc/ceph.in25
-rwxr-xr-xsrc/test/admin_socket/objecter_requests2
2 files changed, 11 insertions, 16 deletions
diff --git a/src/ceph.in b/src/ceph.in
index 196d6be7b54..48b40446032 100755
--- a/src/ceph.in
+++ b/src/ceph.in
@@ -1569,7 +1569,7 @@ def main():
prefix = ''
suffix = ''
if not parsed_args.output_file and len(targets) > 1:
- prefix='{0}.{1}:'.format(*target)
+ prefix='{0}.{1}: '.format(*target)
suffix='\n'
ret, outbuf, outs = json_command(target=target,
@@ -1578,25 +1578,16 @@ def main():
if ret == -errno.EINVAL:
# send command to old monitor or OSD
if verbose:
- print prefix, '{0} to old {1}'.format(' '.join(childargs), target[0])
+ print prefix + '{0} to old {1}'.format(' '.join(childargs), target[0])
compat = True
if parsed_args.output_format:
childargs.extend(['--format', parsed_args.output_format])
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
- print >> sys.stderr, prefix, \
- 'Problem getting command descriptions from {0}, {1}'.\
- format(target, errno.errorcode[ret])
+ outs = 'problem getting command descriptions from {0}.{1}'.format(*target)
else:
sigdict = parse_json_funcsigs(outbuf)
@@ -1608,7 +1599,7 @@ def main():
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[ret], outs)
if len(targets) > 1:
final_ret = ret
else:
@@ -1616,7 +1607,11 @@ def main():
# 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)
@@ -1642,7 +1637,7 @@ def main():
outf.close()
if final_ret:
- return ret
+ return final_ret
return 0
diff --git a/src/test/admin_socket/objecter_requests b/src/test/admin_socket/objecter_requests
index bd09d9ba1d5..8083dcafe88 100755
--- a/src/test/admin_socket/objecter_requests
+++ b/src/test/admin_socket/objecter_requests
@@ -13,7 +13,7 @@ def main():
read = sys.stdin.read()
reqs = json.loads(read)
- op_types = ['linger_ops', 'ops', 'pool_ops', 'pool_stat_ops', 'statfs_ops']
+ op_types = ['linger_ops', 'ops', 'pool_ops', 'pool_stat_ops', 'statfs_ops', 'command_ops']
assert sorted(reqs.keys()) == sorted(op_types)
found_error = check_osd_ops(reqs['ops'] + reqs['linger_ops'])