| 208 | } |
| 209 | |
| 210 | void PyModuleRegistry::active_start( |
| 211 | DaemonStateIndex &ds, ClusterState &cs, |
| 212 | const std::map<std::string, std::string> &kv_store, |
| 213 | bool mon_provides_kv_sub, |
| 214 | MonClient &mc, LogChannelRef clog_, LogChannelRef audit_clog_, |
| 215 | Objecter &objecter_, Finisher &f, |
| 216 | DaemonServer &server) |
| 217 | { |
| 218 | std::lock_guard locker(lock); |
| 219 | |
| 220 | dout(4) << "Starting modules in active mode" << dendl; |
| 221 | |
| 222 | ceph_assert(active_modules == nullptr); |
| 223 | |
| 224 | // Must have seen a MgrMap by this point, in order to know |
| 225 | // which modules should be enabled |
| 226 | ceph_assert(mgr_map.epoch > 0); |
| 227 | |
| 228 | if (standby_modules != nullptr) { |
| 229 | standby_modules->shutdown(); |
| 230 | standby_modules.reset(); |
| 231 | } |
| 232 | |
| 233 | active_modules.reset( |
| 234 | new ActivePyModules( |
| 235 | module_config, |
| 236 | kv_store, mon_provides_kv_sub, |
| 237 | ds, cs, mc, |
| 238 | clog_, audit_clog_, objecter_, f, server, |
| 239 | *this, thread_monitor.get())); |
| 240 | |
| 241 | for (const auto &i : modules) { |
| 242 | // Anything we're skipping because of !can_run will be flagged |
| 243 | // to the user separately via get_health_checks |
| 244 | if (!(i.second->is_enabled() && i.second->is_loaded())) { |
| 245 | dout(8) << __func__ << " Not starting module '" << i.first << "', it is " |
| 246 | << "not enabled and loaded" << dendl; |
| 247 | continue; |
| 248 | } |
| 249 | |
| 250 | // These are always-on modules but user force-disabled them. |
| 251 | if (mgr_map.force_disabled_modules.find(i.first) != |
| 252 | mgr_map.force_disabled_modules.end()) { |
| 253 | dout(8) << __func__ << " Not starting module '" << i.first << "', it is " |
| 254 | << "force-disabled" << dendl; |
| 255 | continue; |
| 256 | } |
| 257 | |
| 258 | dout(4) << "Starting module '" << i.first << "'" << dendl; |
| 259 | active_modules->start_one(i.second); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | std::string PyModuleRegistry::get_site_packages() |
| 264 | { |