From: John Spray Date: Thu, 15 Jan 2015 14:21:51 +0000 (+0000) Subject: mon/MDSMonitor: make 'mds fail' idempotent for IDs X-Git-Tag: v0.93~283^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=889969e21df7a8809e7eabc8127ce2335c85769b;p=ceph.git mon/MDSMonitor: make 'mds fail' idempotent for IDs Was returning ENOENT, should succeed for 'fail' on a non-existent name, as the fail operation makes it cease to exist. Signed-off-by: John Spray --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index bd518ffe3b48..f4366155b942 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -874,8 +874,9 @@ int MDSMonitor::fail_mds(std::ostream &ss, const std::string &arg) // Try to interpret the arg as an MDS name const MDSMap::mds_info_t *mds_info = mdsmap.find_by_name(arg); if (!mds_info) { - ss << "Can't find any MDS named '" << arg << "'"; - return -ENOENT; + ss << "MDS named '" << arg + << "' does not exist, or is not up"; + return 0; } if (mds_info->rank >= 0) { dout(10) << __func__ << ": resolved MDS name '" << arg << "' to rank " << rank_or_gid << dendl;