From: John Spray Date: Wed, 30 Aug 2017 12:56:39 +0000 (+0100) Subject: mgr: remove old-style config opt usage X-Git-Tag: v13.0.1~834^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec09a7abc515f802451bf7ef3d22ce8ee6c6c7b3;p=ceph.git mgr: remove old-style config opt usage Signed-off-by: John Spray --- diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 40feeadd355b..648b14e91251 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1539,23 +1539,6 @@ OPTION(rgw_shard_warning_threshold, OPT_DOUBLE) // pct of safe max OPTION(rgw_swift_versioning_enabled, OPT_BOOL) // whether swift object versioning feature is enabled -OPTION(mgr_module_path, OPT_STR) // where to load python modules from -OPTION(mgr_initial_modules, OPT_STR) // Which modules to load -OPTION(mgr_data, OPT_STR) // where to find keyring etc -OPTION(mgr_tick_period, OPT_INT) // How frequently to tick -OPTION(mgr_stats_period, OPT_INT) // How frequently clients send stats -OPTION(mgr_client_bytes, OPT_U64) // bytes from clients -OPTION(mgr_client_messages, OPT_U64) // messages from clients -OPTION(mgr_osd_bytes, OPT_U64) // bytes from osds -OPTION(mgr_osd_messages, OPT_U64) // messages from osds -OPTION(mgr_mds_bytes, OPT_U64) // bytes from mdss -OPTION(mgr_mds_messages, OPT_U64) // messages from mdss -OPTION(mgr_mon_bytes, OPT_U64) // bytes from mons -OPTION(mgr_mon_messages, OPT_U64) // messages from mons - -OPTION(mgr_connect_retry_interval, OPT_DOUBLE) -OPTION(mgr_service_beacon_grace, OPT_DOUBLE) - OPTION(rgw_crypt_require_ssl, OPT_BOOL) // requests including encryption key headers must be sent over ssl OPTION(rgw_crypt_default_encryption_key, OPT_STR) // base64 encoded key for encryption of rgw objects OPTION(rgw_crypt_s3_kms_encryption_keys, OPT_STR) // extra keys that may be used for aws:kms diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index e9e6bf28acd8..52ea2b8807ba 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -46,21 +46,21 @@ DaemonServer::DaemonServer(MonClient *monc_, LogChannelRef audit_clog_) : Dispatcher(g_ceph_context), client_byte_throttler(new Throttle(g_ceph_context, "mgr_client_bytes", - g_conf->mgr_client_bytes)), + g_conf->get_val("mgr_client_bytes"))), client_msg_throttler(new Throttle(g_ceph_context, "mgr_client_messages", - g_conf->mgr_client_messages)), + g_conf->get_val("mgr_client_messages"))), osd_byte_throttler(new Throttle(g_ceph_context, "mgr_osd_bytes", - g_conf->mgr_osd_bytes)), + g_conf->get_val("mgr_osd_bytes"))), osd_msg_throttler(new Throttle(g_ceph_context, "mgr_osd_messsages", - g_conf->mgr_osd_messages)), + g_conf->get_val("mgr_osd_messages"))), mds_byte_throttler(new Throttle(g_ceph_context, "mgr_mds_bytes", - g_conf->mgr_mds_bytes)), + g_conf->get_val("mgr_mds_bytes"))), mds_msg_throttler(new Throttle(g_ceph_context, "mgr_mds_messsages", - g_conf->mgr_mds_messages)), + g_conf->get_val("mgr_mds_messages"))), mon_byte_throttler(new Throttle(g_ceph_context, "mgr_mon_bytes", - g_conf->mgr_mon_bytes)), + g_conf->get_val("mgr_mon_bytes"))), mon_msg_throttler(new Throttle(g_ceph_context, "mgr_mon_messsages", - g_conf->mgr_mon_messages)), + g_conf->get_val("mgr_mon_messages"))), msgr(nullptr), monc(monc_), finisher(finisher_), @@ -1302,7 +1302,7 @@ bool DaemonServer::handle_command(MCommand *m) void DaemonServer::_prune_pending_service_map() { utime_t cutoff = ceph_clock_now(); - cutoff -= g_conf->mgr_service_beacon_grace; + cutoff -= g_conf->get_val("mgr_service_beacon_grace"); auto p = pending_service_map.services.begin(); while (p != pending_service_map.services.end()) { auto q = p->second.daemons.begin(); @@ -1342,7 +1342,7 @@ void DaemonServer::_prune_pending_service_map() void DaemonServer::send_report() { if (!pgmap_ready) { - if (ceph_clock_now() - started_at > g_conf->mgr_stats_period * 4.0) { + if (ceph_clock_now() - started_at > g_conf->get_val("mgr_stats_period") * 4.0) { pgmap_ready = true; reported_osds.clear(); dout(1) << "Giving up on OSDs that haven't reported yet, sending " diff --git a/src/mgr/MgrClient.cc b/src/mgr/MgrClient.cc index 5f40b2b54c10..80cf3ca36388 100644 --- a/src/mgr/MgrClient.cc +++ b/src/mgr/MgrClient.cc @@ -111,7 +111,7 @@ void MgrClient::reconnect() if (last_connect_attempt != utime_t()) { utime_t now = ceph_clock_now(); utime_t when = last_connect_attempt; - when += cct->_conf->mgr_connect_retry_interval; + when += cct->_conf->get_val("mgr_connect_retry_interval"); if (now < when) { if (!connect_retry_callback) { connect_retry_callback = timer.add_event_at( diff --git a/src/mgr/MgrStandby.cc b/src/mgr/MgrStandby.cc index 07157736137f..70542754ece3 100644 --- a/src/mgr/MgrStandby.cc +++ b/src/mgr/MgrStandby.cc @@ -194,10 +194,10 @@ void MgrStandby::tick() active_mgr->tick(); } - timer.add_event_after(g_conf->mgr_tick_period, new FunctionContext( - [this](int r){ + timer.add_event_after(g_conf->get_val("mgr_tick_period"), + new FunctionContext([this](int r){ tick(); - } + } )); } diff --git a/src/mgr/PyModules.cc b/src/mgr/PyModules.cc index 9a0abb3b363c..1b367305d6b3 100644 --- a/src/mgr/PyModules.cc +++ b/src/mgr/PyModules.cc @@ -399,7 +399,7 @@ int PyModules::init() // Configure sys.path to include mgr_module_path std::string sys_path = std::string(Py_GetPath()) + ":" + get_site_packages() - + ":" + g_conf->mgr_module_path; + + ":" + g_conf->get_val("mgr_module_path"); dout(10) << "Computed sys.path '" << sys_path << "'" << dendl; // Drop the GIL and remember the main thread state (current @@ -843,7 +843,7 @@ static void _list_modules( void PyModules::list_modules(std::set *modules) { - _list_modules(g_conf->mgr_module_path, modules); + _list_modules(g_conf->get_val("mgr_module_path"), modules); } void PyModules::set_health_checks(const std::string& handle,