]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/PyFormatter: implement dump_format_va 15634/head
authorSage Weil <sage@redhat.com>
Mon, 12 Jun 2017 04:02:30 +0000 (00:02 -0400)
committerSage Weil <sage@redhat.com>
Mon, 12 Jun 2017 13:57:00 +0000 (09:57 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/PyFormatter.cc

index abeb420c0b9841a0f05c31e3b11f521abe39c9ab..4c9aec30537135287ec6678fec1b2cbfd5736aa0 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "PyFormatter.h"
 
+#define LARGE_SIZE 1024
+
 
 void PyFormatter::open_array_section(const char *name)
 {
@@ -85,8 +87,10 @@ std::ostream& PyFormatter::dump_stream(const char *name)
 
 void PyFormatter::dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap)
 {
-  // TODO
-  ceph_abort();
+  char buf[LARGE_SIZE];
+  vsnprintf(buf, LARGE_SIZE, fmt, ap);
+
+  dump_pyobject(name, PyString_FromString(buf));
 }
 
 /**