mirror of
https://github.com/ceph/ceph
synced 2025-02-20 17:37:29 +00:00
Merge pull request #15865 from tchaikov/wip-mgr-pg-command
mgr: enable ceph_send_command() to send pg command Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
commit
cf206cc35c
@ -152,7 +152,24 @@ ceph_send_command(PyObject *self, PyObject *args)
|
||||
return nullptr;
|
||||
}
|
||||
} else if (std::string(type) == "pg") {
|
||||
// TODO: expose objecter::pg_command
|
||||
pg_t pgid;
|
||||
if (!pgid.parse(name)) {
|
||||
delete c;
|
||||
string msg("invalid pgid: ");
|
||||
msg.append("\"").append(name).append("\"");
|
||||
PyErr_SetString(PyExc_ValueError, msg.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ceph_tid_t tid;
|
||||
global_handle->get_objecter().pg_command(
|
||||
pgid,
|
||||
{cmd_json},
|
||||
{},
|
||||
&tid,
|
||||
&c->outbl,
|
||||
&c->outs,
|
||||
c);
|
||||
return nullptr;
|
||||
} else {
|
||||
string msg("unknown service type: ");
|
||||
|
@ -2203,7 +2203,7 @@ public:
|
||||
onfinish);
|
||||
submit_command(c, ptid);
|
||||
}
|
||||
void pg_command(pg_t pgid, vector<string>& cmd,
|
||||
void pg_command(pg_t pgid, const vector<string>& cmd,
|
||||
const bufferlist& inbl, ceph_tid_t *ptid,
|
||||
bufferlist *poutbl, string *prs, Context *onfinish) {
|
||||
CommandOp *c = new CommandOp(
|
||||
|
Loading…
Reference in New Issue
Block a user