MCPcopy Create free account
hub / github.com/ceph/ceph / cmd_getval_compat_cephbool

Function cmd_getval_compat_cephbool

src/common/cmdparse.cc:726–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

724}
725
726bool cmd_getval_compat_cephbool(
727 const cmdmap_t& cmdmap,
728 const std::string& k, bool& val)
729{
730 try {
731 return cmd_getval(cmdmap, k, val);
732 } catch (bad_cmd_get& e) {
733 // try as legacy/compat CephChoices
734 std::string t;
735 if (!cmd_getval(cmdmap, k, t)) {
736 return false;
737 }
738 std::string expected = "--"s + k;
739 std::replace(expected.begin(), expected.end(), '_', '-');
740 val = (t == expected);
741 return true;
742 }
743}
744
745}

Callers 5

_handle_commandMethod · 0.85
prepare_commandMethod · 0.85
preprocess_commandMethod · 0.85
preprocess_commandMethod · 0.85
prepare_command_implMethod · 0.85

Calls 4

replaceFunction · 0.85
cmd_getvalFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected