From: Joao Eduardo Luis Date: Mon, 13 Feb 2017 00:31:33 +0000 (+0000) Subject: mon: drop weird/failed mon features debug cli X-Git-Tag: v12.0.1~170^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=545bc83568d653bcede208e0d869bc2d187fd37b;p=ceph.git mon: drop weird/failed mon features debug cli Signed-off-by: Joao Eduardo Luis --- diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index fb0276c96da7..0d7dde8907a4 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -441,22 +441,6 @@ COMMAND("mon remove " \ COMMAND("mon rm " \ "name=name,type=CephString", \ "remove monitor named ", "mon", "rw", "cli,rest") -COMMAND("mon debug set_feature" \ - "name=feature_type,type=CephChoices,strings=persistent|optional " \ - "name=feature_name,type=CephString " \ - "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ - "set provided feature on mon map", \ - "mon", "rw", "cli") -COMMAND("mon debug list_features " \ - "name=feature_type,type=CephString,req=false", \ - "list available mon map features to be set/unset", \ - "mon", "rw", "cli") -COMMAND("mon debug unset_feature " \ - "name=feature_type,type=CephChoices,strings=persistent|optional " \ - "name=feature_name,type=CephString " \ - "name=sure,type=CephChoices,strings=--yes-i-really-mean-it,req=false", \ - "unset provided feature from monmap", \ - "mon", "rw", "cli") /* * OSD commands diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index b09638dd0973..7205fdc638c2 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -331,123 +331,6 @@ void Monitor::do_admin_command(string command, cmdmap_t& cmdmap, string format, if (f) { f->flush(ss); } - } else if (boost::starts_with(command, "debug mon features")) { - - // check if unsupported feature is set - if (!cct->check_experimental_feature_enabled("mon_debug_features_commands")) { - ss << "error: this is an experimental feature and is not enabled."; - goto abort; - } - - if (command == "debug mon features list") { - - mon_feature_t supported = ceph::features::mon::get_supported(); - mon_feature_t persistent = ceph::features::mon::get_persistent(); - - if (f) { - - f->open_object_section("features"); - f->open_object_section("ceph-mon"); - supported.dump_with_value(f.get(), "supported"); - persistent.dump_with_value(f.get(), "persistent"); - f->close_section(); // ceph-mon - f->open_object_section("monmap"); - monmap->persistent_features.dump_with_value(f.get(), "persistent"); - monmap->optional_features.dump_with_value(f.get(), "optional"); - mon_feature_t required = monmap->get_required_features(); - required.dump_with_value(f.get(), "required"); - f->close_section(); // monmap - f->close_section(); // features - - f->flush(ss); - } else { - ss << "only structured formats allowed when listing"; - } - } else if (command == "debug mon features set" || - command == "debug mon features set_val" || - command == "debug mon features unset" || - command == "debug mon features unset_val") { - - string n; - if (!cmd_getval(cct, cmdmap, "feature", n)) { - ss << "missing feature to set"; - goto abort; - } - - string f_type; - bool do_persistent = false, do_optional = false; - - if (cmd_getval(cct, cmdmap, "feature_type", f_type)) { - if (f_type == "--persistent") { - do_persistent = true; - } else { - do_optional = true; - } - } - - mon_feature_t feature; - - if (command == "debug mon features set" || - command == "debug mon features unset") { - feature = ceph::features::mon::get_feature_by_name(n); - if (feature == ceph::features::mon::FEATURE_NONE) { - ss << "no such feature '" << n << "'"; - goto abort; - } - } else { - uint64_t feature_val; - string interr; - feature_val = strict_strtoll(n.c_str(), 10, &interr); - if (!interr.empty()) { - ss << "unable to parse feature value: " << interr; - goto abort; - } - - feature = mon_feature_t(feature_val); - } - - bool do_unset = false; - if (boost::ends_with(command, "unset") || - boost::ends_with(command, "unset_val")) { - do_unset = true; - } - - ss << (do_unset? "un" : "") << "setting feature '"; - feature.print_with_value(ss); - ss << "' on current monmap\n"; - ss << "please note this change is not persistent; " - << "changes to monmap will overwrite the changes\n"; - - if (!do_persistent && !do_optional) { - if (ceph::features::mon::get_persistent().contains_all(feature)) { - do_persistent = true; - } else { - do_optional = true; - } - } - - ss << "\n" << (do_unset ? "un" : "") << "setting "; - - mon_feature_t &target_feature = (do_persistent ? - monmap->persistent_features : monmap->optional_features); - - if (do_persistent) { - ss << "persistent feature"; - } else { - ss << "optional feature"; - } - - if (do_unset) { - target_feature.unset_feature(feature); - } else { - target_feature.set_feature(feature); - } - - } else { - - ss << "unrecognized command"; - } - } else { assert(0 == "bad AdminSocket command binding"); }