]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/config: Add methods to return the default value of a config option
authorSridhar Seshasayee <sseshasa@redhat.com>
Wed, 30 Jun 2021 09:22:50 +0000 (14:52 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Fri, 30 Jul 2021 12:46:00 +0000 (18:16 +0530)
commit9438e5a4b6b16e7ca3276c94c05ec73541690c10
tree83064aa0daecfae4a8c815cc8e92c6ca812290bc
parent1fca4bdfd4c919907247f8f31a3f9e6ca7a11653
common/config: Add methods to return the default value of a config option

Add wrapper method "get_val_default()" to the ConfigProxy class that takes
the config option key to search. This method in-turn calls another method
with the same name added to md_config_t class that does the actual work of
searching for the config option. If the option is valid, _get_val_default()
is used to get the default value. Otherwise, the wrapper method returns
std::nullopt.

Fixes: https://tracker.ceph.com/issues/51464
Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
src/common/config.cc
src/common/config.h
src/common/config_proxy.h