From d5bec875cab9179620f30cef065c85a58a6c630f Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Wed, 11 Nov 2015 23:57:16 -0800 Subject: [PATCH] pybind/rbd: encode snap_rename args for py3 Signed-off-by: Josh Durgin --- src/pybind/rbd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pybind/rbd.py b/src/pybind/rbd.py index 5c681e9213f51..3831ec78c6c63 100644 --- a/src/pybind/rbd.py +++ b/src/pybind/rbd.py @@ -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)) -- 2.39.5