From: Matt Benjamin Date: Thu, 1 Sep 2022 15:33:31 +0000 (-0400) Subject: rgwlib: robustify non-default initialization X-Git-Tag: v18.0.0~56^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2282a803b28f684e7dcfa73958c2b0efee2e785f;p=ceph.git 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 --- diff --git a/src/rgw/rgw_appmain.cc b/src/rgw/rgw_appmain.cc index 69a492dd2351..0d99df0c1c96 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"); }