Skip to content

Commit

Permalink
rgw: fix default_placement containing "/" when storage_class is standard
Browse files Browse the repository at this point in the history
fixes: http://tracker.ceph.com/issues/39380

Signed-off-by: mkogan1 <mkogan@redhat.com>
(cherry picked from commit 0b63ef8)
  • Loading branch information
mkogan1 authored and smithfarm committed Jun 13, 2019
1 parent 27c50b2 commit 26d56e0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/rgw/rgw_common.h
Expand Up @@ -695,7 +695,7 @@ struct rgw_placement_rule {

void encode(bufferlist& bl) const {
/* no ENCODE_START/END due to backward compatibility */
std::string s = to_str_explicit();
std::string s = to_str();
ceph::encode(s, bl);
}

Expand All @@ -720,12 +720,11 @@ struct rgw_placement_rule {
size_t pos = s.find("/");
if (pos == std::string::npos) {
name = s;
storage_class.clear();
return;
}
name = s.substr(0, pos);
if (pos < s.size() - 1) {
storage_class = s.substr(pos + 1);
}
storage_class = s.substr(pos + 1);
}

bool standard_storage_class() const {
Expand Down

0 comments on commit 26d56e0

Please sign in to comment.