]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwlib: robustify non-default initialization
authorMatt Benjamin <mbenjamin@redhat.com>
Thu, 1 Sep 2022 15:33:31 +0000 (11:33 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 9 Sep 2022 15:17:32 +0000 (11:17 -0400)
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 <mbenjamin@redhat.com>
src/rgw/rgw_appmain.cc

index 69a492dd235168a339c2ed3a35177963c8bc4421..0d99df0c1c966c5b7c81ddce99e7d22da0df3ce9 100644 (file)
@@ -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");
     }