From: Javier Guerra Date: Wed, 18 Mar 2015 19:46:13 +0000 (-0500) Subject: rados.py: fix Object.write() method X-Git-Tag: v9.0.0~151^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4072%2Fhead;p=ceph.git rados.py: fix Object.write() method the file position should advance by the number of bytes written, but the ioctx.write() function returns 0 on success Signed-off-by: Javier Guerra --- diff --git a/src/pybind/rados.py b/src/pybind/rados.py index f1ca5469680b..fb2da93e2d35 100644 --- a/src/pybind/rados.py +++ b/src/pybind/rados.py @@ -2007,7 +2007,8 @@ class Object(object): def write(self, string_to_write): self.require_object_exists() ret = self.ioctx.write(self.key, string_to_write, self.offset) - self.offset += ret + if ret == 0: + self.offset += len(string_to_write) return ret @set_object_locator