]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: some region/zone related cleanups/fixes
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 20 Feb 2013 01:57:06 +0000 (17:57 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Wed, 8 May 2013 17:54:53 +0000 (10:54 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index bf36684c2caac3564511a335a6e343a33f89670e..4070c19fb10aaa0b8be69beba8341a5c22b0eccb 100644 (file)
@@ -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);
   }
 
index 2027b44f4b8f5e10ced8751b50ae39cca18e13e3..c0a23d4dd8bb8424a55ff16ede0e67e7fd273d76 100644 (file)
@@ -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;
index 41d1243065e11dc644cb4db8509e12e4787cbf52..f0568013df5ca5db81b3e1cdf916a2913f71e201 100644 (file)
@@ -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();
   }