]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: rados_X_command need to assemble a vector from char *cmd
authorDan Mick <dan.mick@inktank.com>
Thu, 6 Jun 2013 20:41:38 +0000 (13:41 -0700)
committerDan Mick <dan.mick@inktank.com>
Fri, 7 Jun 2013 01:46:53 +0000 (18:46 -0700)
The old monitors take a vector with words split; new monitors don't
care, but the old ones do

Signed-off-by: Dan Mick <dan.mick@inktank.com>
src/librados/librados.cc

index c69445551f7e2e72648e409fa07b916c181a30df..e624eebea8237a4f1e0d902f7195e778b4bc5b79 100644 (file)
@@ -24,6 +24,7 @@
 #include "librados/IoCtxImpl.h"
 #include "librados/PoolAsyncCompletionImpl.h"
 #include "librados/RadosClient.h"
+#include "include/str_list.h"
 
 #include <string>
 #include <map>
@@ -1761,6 +1762,7 @@ extern "C" int rados_mon_command(rados_t cluster, const char *cmd,
   string outstring;
   vector<string> cmdvec;
 
+  get_str_vec(string(cmd), cmdvec);
   cmdvec.push_back(cmd);
   inbl.append(inbuf, inbuflen);
   int ret = client->mon_command(cmdvec, inbl, &outbl, &outstring);
@@ -1781,7 +1783,7 @@ extern "C" int rados_osd_command(rados_t cluster, int osdid, const char *cmd,
   string outstring;
   vector<string> cmdvec;
 
-  cmdvec.push_back(cmd);
+  get_str_vec(string(cmd), cmdvec);
   inbl.append(inbuf, inbuflen);
   int ret = client->osd_command(osdid, cmdvec, inbl, &outbl, &outstring);
 
@@ -1805,7 +1807,7 @@ extern "C" int rados_pg_command(rados_t cluster, const char *pgstr,
   pg_t pgid;
   vector<string> cmdvec;
 
-  cmdvec.push_back(cmd);
+  get_str_vec(string(cmd), cmdvec);
   inbl.append(inbuf, inbuflen);
   if (!pgid.parse(pgstr))
     return -EINVAL;