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);
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);
}
if (opt_cmd == OPT_ZONE_INFO) {
- store->zone.dump(formatter);
+ encode_json("zone", store->zone, formatter);
formatter->flush(cout);
}
return 1;
}
- zone.dump(formatter);
+ encode_json("zone", store->zone, formatter);
formatter->flush(cout);
}
name = "default";
string zone_name = "default";
- RGWZone default_zone;
+ RGWZone& default_zone = zones[zone_name];
default_zone.name = zone_name;
RGWZoneParams zone_params;
r = store_info(true);
if (r < 0) {
derr << "error storing region info: " << cpp_strerror(-r) << dendl;
+ return r;
}
return 0;
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();
}