]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: filter out empty virtual bucket hostnames
authorCasey Bodley <cbodley@redhat.com>
Mon, 3 Oct 2016 18:05:08 +0000 (14:05 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 3 Oct 2016 18:25:23 +0000 (14:25 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rest.cc

index 76336456a757914d8c5fe92cc81b43e179acc697..c0740cc481e0ec72efe61ac984802b8e3ac414e4 100644 (file)
@@ -205,10 +205,9 @@ void rgw_rest_init(CephContext *cct, RGWRados *store, RGWZoneGroup& zone_group)
     http_status_names[h->code] = h->name;
   }
 
-  if (!cct->_conf->rgw_dns_name.empty()) {
-    hostnames_set.insert(cct->_conf->rgw_dns_name);
-  }
-  hostnames_set.insert(zone_group.hostnames.begin(),  zone_group.hostnames.end());
+  hostnames_set.insert(cct->_conf->rgw_dns_name);
+  hostnames_set.insert(zone_group.hostnames.begin(), zone_group.hostnames.end());
+  hostnames_set.erase(""); // filter out empty hostnames
   string s;
   ldout(cct, 20) << "RGW hostnames: " << std::accumulate(hostnames_set.begin(), hostnames_set.end(), s) << dendl;
   /* TODO: We should have a sanity check that no hostname matches the end of
@@ -221,10 +220,9 @@ void rgw_rest_init(CephContext *cct, RGWRados *store, RGWZoneGroup& zone_group)
    * X.B.A ambigously splits to both {X, B.A} and {X.B, A}
    */
 
-  if (!cct->_conf->rgw_dns_s3website_name.empty()) {
-    hostnames_s3website_set.insert(cct->_conf->rgw_dns_s3website_name);
-  }
+  hostnames_s3website_set.insert(cct->_conf->rgw_dns_s3website_name);
   hostnames_s3website_set.insert(zone_group.hostnames_s3website.begin(), zone_group.hostnames_s3website.end());
+  hostnames_s3website_set.erase(""); // filter out empty hostnames
   s.clear();
   ldout(cct, 20) << "RGW S3website hostnames: " << std::accumulate(hostnames_s3website_set.begin(), hostnames_s3website_set.end(), s) << dendl;
   /* TODO: we should repeat the hostnames_set sanity check here