From 10750f803fbba91bfd1a5b2e6a87d63bf8ff5a80 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 6 Jun 2011 13:06:41 -0700 Subject: [PATCH] common: add module_type to CephContext; use to initialize rotating keys This fixes rotating keys. Signed-off-by: Sage Weil --- src/common/ceph_context.cc | 1 + src/common/ceph_context.h | 2 ++ src/common/common_init.cc | 2 ++ src/mon/MonClient.cc | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index 711f6b643b0a9..fd104ffb33153 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -82,6 +82,7 @@ CephContext:: CephContext() : _doss(new DoutStreambuf ::traits_type>()), _dout(_doss), + module_type(0), _prof_logger_conf_obs(new ProfLoggerConfObs()), _service_thread(NULL) { diff --git a/src/common/ceph_context.h b/src/common/ceph_context.h index ef16583e4eff9..42048528aee82 100644 --- a/src/common/ceph_context.h +++ b/src/common/ceph_context.h @@ -41,6 +41,8 @@ public: DoutStreambuf ::traits_type> *_doss; std::ostream _dout; + unsigned module_type; + /* Start the Ceph Context's service thread */ void start_service_thread(); diff --git a/src/common/common_init.cc b/src/common/common_init.cc index a1124e8bdf915..c436f7cd8d056 100644 --- a/src/common/common_init.cc +++ b/src/common/common_init.cc @@ -94,6 +94,8 @@ void common_init(std::vector < const char* >& args, CephContext *cct = common_preinit(iparams, code_env, flags); md_config_t *conf = cct->_conf; + cct->module_type = module_type; + std::deque parse_errors; int ret = conf->parse_config_files(iparams.get_conf_files(), &parse_errors); if (ret == -EDOM) { diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 60babf647d244..2fc67c1c2719a 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -330,7 +330,7 @@ int MonClient::init() derr << "MonClient::init(): Failed to create keyring" << dendl; return -EDOM; } - rotating_secrets = new RotatingKeyRing(CEPH_ENTITY_TYPE_OSD, keyring); + rotating_secrets = new RotatingKeyRing(cct->module_type, keyring); entity_name = g_conf.name; -- 2.39.5