From b2fcb62b7a7d7816d7d31059d63b1dab6a8a251a Mon Sep 17 00:00:00 2001 From: liuchang0812 Date: Thu, 25 May 2017 22:06:47 +0800 Subject: [PATCH] tool/ceph: remove old mon support and verbose support Signed-off-by: liuchang0812 --- src/ceph.in | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/ceph.in b/src/ceph.in index 4ba58d2d4b0..605b12eedc1 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -186,10 +186,6 @@ def mdsids(): def mgrids(): ret, outbuf, outs = json_command(cluster_handle, prefix='mgr dump', argdict={'format': 'json'}) - if ret == -errno.EINVAL: - # try old mon - ret, outbuf, outs = send_command(cluster_handle, - cmd=['mgr', 'dump', '--format=json']) if ret: raise RuntimeError('Can\'t contact mon for mgr list') @@ -224,23 +220,20 @@ def validate_target(target): elif service_name == "mgr": exist_ids = mgrids() else: - if verbose: print('WARN: {0} is not a legal service name, should be one of mon/osd/mds/mgr'.format(service_name), file=sys.stderr) - return False + return False if service_id in exist_ids: ret = True - - if not ret and verbose: + else: print('WARN: the service id you provided does not exist. service id should ' 'be one of {0}.'.format('/'.join(exist_ids)), file=sys.stderr) - elif len(_target) == 1 and _target[0] == "mgr": + elif len(_target) == 1 and _target[0] == 'mgr': ret = True else: - if verbose: - print('WARN: \"{0}\" is not a legal target. it should be one of mon./osd./mds./mgr.'.format(target), file=sys.stderr) + print('WARN: \"{0}\" is not a legal target. it should be one of mon./osd./mds./mgr.'.format(target), file=sys.stderr) return ret -- 2.39.5