diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-02-19 17:57:06 -0800 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-02-19 17:57:06 -0800 |
commit | 44976a79fda201e38c9e36ac6d00d299b5c07bca (patch) | |
tree | 9aeed716016c7ae72a3ef646a309d25a9a0e9511 | |
parent | 6a07608ceac4524120ef60ce456998e41f750248 (diff) | |
download | ceph-44976a79fda201e38c9e36ac6d00d299b5c07bca.tar.gz |
rgw: some region/zone related cleanups/fixes
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_admin.cc | 10 | ||||
-rw-r--r-- | src/rgw/rgw_rados.cc | 3 | ||||
-rw-r--r-- | src/rgw/rgw_rados.h | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 01792999670..2d427d9a9ce 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -850,7 +850,7 @@ int main(int argc, char **argv) return usage(); } - bool region_op = (opt_cmd == OPT_REGION_INFO); + bool raw_storage_op = (opt_cmd == OPT_REGION_INFO); user_modify_op = (opt_cmd == OPT_USER_MODIFY || opt_cmd == OPT_SUBUSER_MODIFY || @@ -858,7 +858,7 @@ int main(int argc, char **argv) opt_cmd == OPT_KEY_CREATE || opt_cmd == OPT_KEY_RM || opt_cmd == OPT_USER_RM || opt_cmd == OPT_CAPS_ADD || opt_cmd == OPT_CAPS_RM); - if (region_op) { + if (raw_storage_op) { store = RGWStoreManager::get_raw_storage(g_ceph_context); } else { store = RGWStoreManager::get_storage(g_ceph_context, false); @@ -870,7 +870,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); @@ -1756,7 +1756,7 @@ next: } if (opt_cmd == OPT_ZONE_INFO) { - store->zone.dump(formatter); + encode_json("zone", store->zone, formatter); formatter->flush(cout); } @@ -1774,7 +1774,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 ddc4da74dff..6fdae86ef28 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -200,7 +200,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; @@ -215,6 +215,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 05105d5a149..2ddc1bd5d51 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -509,7 +509,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(); } |