summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-02-19 17:57:06 -0800
committerYehuda Sadeh <yehuda@inktank.com>2013-03-22 11:23:57 -0700
commit09860e236efdc01c804713aa8649571f5055d711 (patch)
tree8e537c2828c87c2b5250ef10306ea16de591f098
parent50d89d4ac4090842bb2b91d1a9b481c4b63e5f5c (diff)
downloadceph-09860e236efdc01c804713aa8649571f5055d711.tar.gz
rgw: some region/zone related cleanups/fixes
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_admin.cc10
-rw-r--r--src/rgw/rgw_rados.cc3
-rw-r--r--src/rgw/rgw_rados.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc
index 756651db28a..804395106f7 100644
--- a/src/rgw/rgw_admin.cc
+++ b/src/rgw/rgw_admin.cc
@@ -981,7 +981,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 ||
@@ -989,7 +989,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);
@@ -1001,7 +1001,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);
@@ -1897,7 +1897,7 @@ next:
}
if (opt_cmd == OPT_ZONE_INFO) {
- store->zone.dump(formatter);
+ encode_json("zone", store->zone, formatter);
formatter->flush(cout);
}
@@ -1915,7 +1915,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 e4e005115c9..cc11e3b1be4 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 6ca34c0337c..f98473857b6 100644
--- a/src/rgw/rgw_rados.h
+++ b/src/rgw/rgw_rados.h
@@ -516,7 +516,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();
}