Merge "rbd: Remove unnecessary 'encode' calls"

This commit is contained in:
Jenkins 2017-09-06 14:41:50 +00:00 committed by Gerrit Code Review
commit 6094365911
3 changed files with 12 additions and 8 deletions

View File

@ -13,7 +13,6 @@
from eventlet import tpool
import mock
import six
from nova.compute import task_states
from nova import exception
@ -223,7 +222,7 @@ class RbdTestCase(test.NoDBTestCase):
self.driver.clone(location, self.volume_name)
args = [client_stack[0].ioctx, six.b(image), six.b(snap),
args = [client_stack[0].ioctx, image, snap,
client_stack[1].ioctx, str(self.volume_name)]
kwargs = {'features': client.features}
rbd.clone.assert_called_once_with(*args, **kwargs)

View File

@ -66,10 +66,9 @@ class RBDVolumeProxy(object):
read_only=False):
client, ioctx = driver._connect_to_rados(pool)
try:
snap_name = snapshot.encode('utf8') if snapshot else None
self.volume = tpool.Proxy(rbd.Image(ioctx, name.encode('utf8'),
snapshot=snap_name,
read_only=read_only))
self.volume = tpool.Proxy(rbd.Image(ioctx, name,
snapshot=snapshot,
read_only=read_only))
except rbd.ImageNotFound:
with excutils.save_and_reraise_exception():
LOG.debug("rbd image %s does not exist", name)
@ -236,8 +235,8 @@ class RBDDriver(object):
with RADOSClient(self, dest_pool) as dest_client:
try:
RbdProxy().clone(src_client.ioctx,
image.encode('utf-8'),
snapshot.encode('utf-8'),
image,
snapshot,
dest_client.ioctx,
str(dest_name),
features=src_client.features)

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Nova now requires Ceph/librados >= 11.1.0 if running under Python 3 with
the RBD image backend for the libvirt driver. Requirements for Python 2
users or users using a different backend remain unchanged.