From 2282a803b28f684e7dcfa73958c2b0efee2e785f Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Thu, 1 Sep 2022 11:33:31 -0400 Subject: [PATCH] rgwlib: robustify non-default initialization Don't rely on the conf-default value of rgw_nfs_frontends to provide "rgw-nfs," as that's not optional when running under librgw. Signed-off-by: Matt Benjamin --- src/rgw/rgw_appmain.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_appmain.cc b/src/rgw/rgw_appmain.cc index 69a492dd235..0d99df0c1c9 100644 --- a/src/rgw/rgw_appmain.cc +++ b/src/rgw/rgw_appmain.cc @@ -98,7 +98,13 @@ void rgw::AppMain::init_frontends1(bool nfs) g_conf().early_expand_meta(rgw_frontends_str, &cerr); get_str_vec(rgw_frontends_str, ",", frontends); - if (!nfs) { + /* default frontends */ + if (nfs) { + const auto is_rgw_nfs = [](const auto& s){return s == "rgw-nfs";}; + if (std::find_if(frontends.begin(), frontends.end(), is_rgw_nfs) == frontends.end()) { + frontends.push_back("rgw-nfs"); + } + } else { if (frontends.empty()) { frontends.push_back("beast"); } -- 2.47.3