]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/ActivePyModules: do not touch PyFormatter without the GIL 27808/head
authorSage Weil <sage@redhat.com>
Thu, 14 Feb 2019 13:24:09 +0000 (07:24 -0600)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 2 Jul 2019 00:49:36 +0000 (08:49 +0800)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 9ad2283db555a38b4951e42001ba884ba2dd86bf)

Conflicts:
there is no "devices" API until Nautilus.

src/mgr/ActivePyModules.cc

index 7cb660ab0af6fbe6921b45d414860d9bb343aba4..f577d48f2025befc1a2e4e7db7648a30c674b2ee 100644 (file)
@@ -98,10 +98,10 @@ PyObject *ActivePyModules::get_server_python(const std::string &hostname)
 
 PyObject *ActivePyModules::list_servers_python()
 {
+  PyFormatter f(false, true);
   PyThreadState *tstate = PyEval_SaveThread();
   dout(10) << " >" << dendl;
 
-  PyFormatter f(false, true);
   daemon_state.with_daemons_by_server([this, &f, &tstate]
       (const std::map<std::string, DaemonStateCollection> &all) {
     PyEval_RestoreThread(tstate);