]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/rbd: encode snap_rename args for py3
authorJosh Durgin <jdurgin@redhat.com>
Thu, 12 Nov 2015 07:57:16 +0000 (23:57 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Fri, 13 Nov 2015 03:35:34 +0000 (19:35 -0800)
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/pybind/rbd.py

index 5c681e9213f517ef80c10e7a96acdd022e41cf5e..3831ec78c6c634f86bb9c3ffd0ef22eaf32af233 100644 (file)
@@ -798,11 +798,11 @@ class Image(object):
         :type dstname: str
         :raises: :class:`ImageExists`
         """
-        if not isinstance(srcname, str):
+        if not isinstance(srcname, str_type):
             raise TypeError('src name must be a string')
-        if not isinstance(dstname, str):
+        if not isinstance(dstname, str_type):
             raise TypeError('dst name must be a string')
-        ret = self.librbd.rbd_snap_rename(self.image, c_char_p(srcname), c_char_p(dstname))
+        ret = self.librbd.rbd_snap_rename(self.image, cstr(srcname), cstr(dstname))
         if ret != 0:
             raise make_ex(ret, 'error renaming snapshot of %s from %s to %s' % (self.name, srcname, dstname))