]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: make 'mds fail' idempotent for IDs 3377/head
authorJohn Spray <john.spray@redhat.com>
Thu, 15 Jan 2015 14:21:51 +0000 (14:21 +0000)
committerJohn Spray <john.spray@redhat.com>
Thu, 15 Jan 2015 14:23:26 +0000 (14:23 +0000)
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 <john.spray@redhat.com>
src/mon/MDSMonitor.cc

index bd518ffe3b481789148423555e3d9abcf22efae2..f4366155b9425f9622e19df6f9771376e8fa3b5d 100644 (file)
@@ -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;