]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer.cc: [Cleanup] Change to using get_val template 18717/head
authorShinobu Kinjo <shinobu@redhat.com>
Sat, 4 Nov 2017 01:28:50 +0000 (10:28 +0900)
committerShinobu Kinjo <shinobu@redhat.com>
Sat, 4 Nov 2017 01:34:48 +0000 (10:34 +0900)
function

Signed-off-by: Shinobu Kinjo <shinobu@redhat.com>
src/mgr/DaemonServer.cc

index 42132d726022851bc1233cf4fe5f16d7689651a7..ba24a56804ea7145a1d8dc51b2597359eadd57b5 100644 (file)
@@ -111,9 +111,10 @@ int DaemonServer::init(uint64_t gid, entity_addr_t client_addr)
                              mon_byte_throttler.get(),
                              mon_msg_throttler.get());
 
-  int r = msgr->bind(g_conf->public_addr);
+  entity_addr_t paddr = g_conf->get_val<entity_addr_t>("public_addr");
+  int r = msgr->bind(paddr);
   if (r < 0) {
-    derr << "unable to bind mgr to " << g_conf->public_addr << dendl;
+    derr << "unable to bind mgr to " << paddr << dendl;
     return r;
   }
 
@@ -893,14 +894,15 @@ bool DaemonServer::handle_command(MCommand *m)
       cmdctx->reply(r, ss);
       return true;
     }
-    double max_change = g_conf->mon_reweight_max_change;
+    
+    double max_change = g_conf->get_val<double>("mon_reweight_max_change");
     cmd_getval(g_ceph_context, cmdctx->cmdmap, "max_change", max_change);
     if (max_change <= 0.0) {
       ss << "max_change " << max_change << " must be positive";
       cmdctx->reply(-EINVAL, ss);
       return true;
     }
-    int64_t max_osds = g_conf->mon_reweight_max_osds;
+    int64_t max_osds = g_conf->get_val<int64_t>("mon_reweight_max_osds");
     cmd_getval(g_ceph_context, cmdctx->cmdmap, "max_osds", max_osds);
     if (max_osds <= 0) {
       ss << "max_osds " << max_osds << " must be positive";