]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/rados: should pass "name" to cstr() 27111/head
authorKefu Chai <kchai@redhat.com>
Fri, 22 Mar 2019 06:25:12 +0000 (14:25 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 22 Mar 2019 06:28:17 +0000 (14:28 +0800)
it's a regression introduced by 6cb23f9c

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/rados/rados.pyx

index 9100c086eaa42762b5b1f106cce1689bb49b733c..24da79c86cd14db291861a7b98fbba476709a9cf 100644 (file)
@@ -556,9 +556,9 @@ def decode_cstr(val, encoding="utf-8"):
     return val.decode(encoding)
 
 
-def flatten_dict(d):
+def flatten_dict(d, name):
     items = chain.from_iterable(d.items())
-    return cstr(''.join(i + '\0' for i in items))
+    return cstr(''.join(i + '\0' for i in items), name)
 
 
 cdef char* opt_str(s) except? NULL:
@@ -1532,7 +1532,7 @@ Rados object in state %s." % self.state)
         """
         service = cstr(service, 'service')
         daemon = cstr(daemon, 'daemon')
-        metadata_dict = flatten_dict(metadata)
+        metadata_dict = flatten_dict(metadata, 'metadata')
         cdef:
             char *_service = service
             char *_daemon = daemon
@@ -1545,7 +1545,7 @@ Rados object in state %s." % self.state)
 
     @requires(('metadata', dict))
     def service_daemon_update(self, status):
-        status_dict = flatten_dict(status)
+        status_dict = flatten_dict(status, 'status')
         cdef:
             char *_status = status_dict