Gil gil(py_module->pMyThreadState, true);
+ dout(10) << "ActivePyModule::handle_command dispatching command '"
+ << cmdmap << dendl;
+
PyFormatter f;
TOPNSPC::common::cmdmap_dump(cmdmap, &f);
PyObject *py_cmd = f.get();
m_command_perms = module_command.perm;
m_session = &session;
+ dout(10) << "ActivePyModule::handle_command calling into interpreter for '"
+ << cmdmap << dendl;
auto pResult = PyObject_CallMethod(pClassInstance,
const_cast<char*>("_handle_command"), const_cast<char*>("s#O"),
instr.c_str(), instr.length(), py_cmd);
+ dout(10) << "ActivePyModule::handle_command call into interpreter complete for '"
+ << cmdmap << dendl;
m_command_perms.clear();
m_session = nullptr;
inbuf: str,
cmd: Dict[str, Any]) -> Union[HandleCommandResult,
Tuple[int, str, str]]:
+ inbuflen = str(len(inbuf)) if inbuf is not None else "None"
+ self.log.debug(f"_handle_command len(inbuf) {inbuflen} cmd {cmd}")
if cmd['prefix'] not in self.CLICommand.COMMANDS: # type: ignore[attr-defined]
- return self.handle_command(inbuf, cmd)
+ ret = self.handle_command(inbuf, cmd)
+ self.log.debug(f"_handle_command len(inbuf) {inbuflen} cmd {cmd} ret {ret}")
+ return ret
- return self.CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf) # type: ignore[attr-defined]
+ ret = self.CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf) # type: ignore[attr-defined]
+ self.log.debug(f"_handle_command len(inbuf) {inbuflen} cmd {cmd} ret {ret}")
+ return ret
def handle_command(self,
inbuf: str,