From 369e484ebcccd9d89245eb2d822a1f578b58506f Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 14 Oct 2015 14:48:51 -0700 Subject: [PATCH] rgw: period oid doesn't include realm id So that realm id is not a dependency for reading period. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_admin.cc | 6 ------ src/rgw/rgw_rados.cc | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 17064377ca455..51ef5db316637 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2034,12 +2034,6 @@ int main(int argc, char **argv) case OPT_REALM_GET: { RGWRealm realm(realm_id, realm_name); -#if 0 - if ( - cerr << "missing realm name or id" << std::endl; - return -EINVAL; - } -#endif int ret = realm.init(g_ceph_context, store); if (ret < 0) { if (ret == -ENOENT && realm_name.empty() && realm_id.empty()) { diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0df99ffb37f7a..4f6509ba74a2c 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -662,7 +662,7 @@ int RGWPeriod::init(CephContext *_cct, RGWRados *_store, bool setup_obj) if (!setup_obj) return 0; - if (id.empty() || realm_id.empty()) { + if (id.empty()) { RGWRealm realm(realm_id, realm_name); int ret = realm.init(cct, store); if (ret < 0) { @@ -702,7 +702,7 @@ const string& RGWPeriod::get_info_oid_prefix() const string RGWPeriod::get_period_oid_prefix() { - return get_info_oid_prefix() + realm_id + "." + id; + return get_info_oid_prefix() + id; } const string RGWPeriod::get_period_oid() @@ -860,7 +860,7 @@ int RGWPeriod::store_info(bool exclusive) rgw_bucket pool(pool_name.c_str()); std::ostringstream oss; - oss << get_info_oid_prefix() << realm_id << "." << id << "." << epoch; + oss << get_info_oid_prefix() << id << "." << epoch; string oid = oss.str(); bufferlist bl; ::encode(*this, bl); -- 2.39.5