]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: lifecycle: fix RGWLifecycleConfiguration::valid()
authorMatt Benjamin <mbenjamin@redhat.com>
Mon, 25 Feb 2019 20:36:07 +0000 (15:36 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 21 May 2019 07:01:10 +0000 (03:01 -0400)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_lc.cc

index 36c75a4c06812fc7d56515861142a68f7b46c812..130bf57301ba52264178bc999ebeff5a94d40677 100644 (file)
@@ -172,32 +172,10 @@ bool RGWLifecycleConfiguration::has_same_action(const lc_op& first, const lc_op&
   return false;
 }
 
-//Rules are conflicted: if one rule's prefix starts with other rule's prefix, and these two rules
-//define same action. 
+/* Formerly, this method checked for duplicate rules using an invalid
+ * method (prefix uniqueness). */
 bool RGWLifecycleConfiguration::valid() 
 {
-  if (prefix_map.size() < 2) {
-    return true;
-  }
-  auto cur_iter = prefix_map.begin();
-  while (cur_iter != prefix_map.end()) {
-    auto next_iter = cur_iter;
-    ++next_iter;
-    while (next_iter != prefix_map.end()) {
-      string c_pre = cur_iter->first;
-      string n_pre = next_iter->first;
-      if (n_pre.compare(0, c_pre.length(), c_pre) == 0) {
-        if (has_same_action(cur_iter->second, next_iter->second)) {
-          return false;
-        } else {
-          ++next_iter;
-        }
-      } else {
-        break;
-      }
-    }
-    ++cur_iter;
-  }
   return true;
 }