From: Yehuda Sadeh Date: Wed, 20 Feb 2013 01:57:06 +0000 (-0800) Subject: rgw: some region/zone related cleanups/fixes X-Git-Tag: v0.67-rc1~128^2~207 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=708339a0fb1759f72bcd7c1bf14639fe3f72fc59;p=ceph.git rgw: some region/zone related cleanups/fixes Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index bf36684c2caa..4070c19fb10a 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -633,10 +633,10 @@ int main(int argc, char **argv) RGWStreamFlusher f(formatter, cout); - bool region_op = (opt_cmd == OPT_REGION_INFO); + bool raw_storage_op = (opt_cmd == OPT_REGION_INFO); - if (region_op) { + if (raw_storage_op) { store = RGWStoreManager::get_raw_storage(g_ceph_context); } else { store = RGWStoreManager::get_storage(g_ceph_context, false); @@ -648,7 +648,7 @@ int main(int argc, char **argv) StoreDestructor store_destructor(store); - if (region_op) { + if (raw_storage_op) { if (opt_cmd == OPT_REGION_INFO) { RGWRegion region; int ret = region.init(g_ceph_context, store); @@ -1205,7 +1205,7 @@ next: } if (opt_cmd == OPT_ZONE_INFO) { - store->zone.dump(formatter); + encode_json("zone", store->zone, formatter); formatter->flush(cout); } @@ -1223,7 +1223,7 @@ next: return 1; } - zone.dump(formatter); + encode_json("zone", store->zone, formatter); formatter->flush(cout); } diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2027b44f4b8f..c0a23d4dd8bb 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -201,7 +201,7 @@ int RGWRegion::create_default() name = "default"; string zone_name = "default"; - RGWZone default_zone; + RGWZone& default_zone = zones[zone_name]; default_zone.name = zone_name; RGWZoneParams zone_params; @@ -216,6 +216,7 @@ int RGWRegion::create_default() r = store_info(true); if (r < 0) { derr << "error storing region info: " << cpp_strerror(-r) << dendl; + return r; } return 0; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 41d1243065e1..f0568013df5c 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -517,7 +517,7 @@ public: CephContext *ctx() { return cct; } /** do all necessary setup of the storage device */ int initialize(CephContext *_cct, bool _use_gc_thread) { - set_context(cct); + set_context(_cct); use_gc_thread = _use_gc_thread; return initialize(); }