From 17798b3a473267fb67aec1272e907c6cd3285b36 Mon Sep 17 00:00:00 2001 From: TommyLike Date: Wed, 2 May 2018 17:44:15 +0800 Subject: [PATCH] Replace cluster object's host with service_topic_queue We have upgrade OVO's 'host' attribute by 'service_topic_queue' when sending rpc messages to support cluster deployment, there are some left unchanged, fix it. TrivialFix Change-Id: I842a15290599181d8d20eb436764764fc9f10687 --- cinder/volume/rpcapi.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cinder/volume/rpcapi.py b/cinder/volume/rpcapi.py index 5568a8cd92f..d263e9401fa 100644 --- a/cinder/volume/rpcapi.py +++ b/cinder/volume/rpcapi.py @@ -169,7 +169,7 @@ class VolumeAPI(rpc.RPCAPI): @rpc.assert_min_rpc_version('3.15') def revert_to_snapshot(self, ctxt, volume, snapshot): version = self._compat_ver('3.15') - cctxt = self._get_cctxt(volume.host, version) + cctxt = self._get_cctxt(volume.service_topic_queue, version) cctxt.cast(ctxt, 'revert_to_snapshot', volume=volume, snapshot=snapshot) @@ -290,7 +290,7 @@ class VolumeAPI(rpc.RPCAPI): def update_migrated_volume(self, ctxt, volume, new_volume, original_volume_status): - cctxt = self._get_cctxt(new_volume['host']) + cctxt = self._get_cctxt(new_volume.service_topic_queue) cctxt.call(ctxt, 'update_migrated_volume', volume=volume, new_volume=new_volume, @@ -434,7 +434,7 @@ class VolumeAPI(rpc.RPCAPI): @rpc.assert_min_rpc_version('3.9') def attachment_update(self, ctxt, vref, connector, attachment_id): version = self._compat_ver('3.9') - cctxt = self._get_cctxt(vref.host, version=version) + cctxt = self._get_cctxt(vref.service_topic_queue, version=version) return cctxt.call(ctxt, 'attachment_update', vref=vref, @@ -444,7 +444,7 @@ class VolumeAPI(rpc.RPCAPI): @rpc.assert_min_rpc_version('3.9') def attachment_delete(self, ctxt, attachment_id, vref): version = self._compat_ver('3.9') - cctxt = self._get_cctxt(vref.host, version=version) + cctxt = self._get_cctxt(vref.service_topic_queue, version=version) return cctxt.call(ctxt, 'attachment_delete', attachment_id=attachment_id, @@ -472,26 +472,26 @@ class VolumeAPI(rpc.RPCAPI): @rpc.assert_min_rpc_version('3.14') def enable_replication(self, ctxt, group): - cctxt = self._get_cctxt(group.host, version='3.14') + cctxt = self._get_cctxt(group.service_topic_queue, version='3.14') cctxt.cast(ctxt, 'enable_replication', group=group) @rpc.assert_min_rpc_version('3.14') def disable_replication(self, ctxt, group): - cctxt = self._get_cctxt(group.host, version='3.14') + cctxt = self._get_cctxt(group.service_topic_queue, version='3.14') cctxt.cast(ctxt, 'disable_replication', group=group) @rpc.assert_min_rpc_version('3.14') def failover_replication(self, ctxt, group, allow_attached_volume=False, secondary_backend_id=None): - cctxt = self._get_cctxt(group.host, version='3.14') + cctxt = self._get_cctxt(group.service_topic_queue, version='3.14') cctxt.cast(ctxt, 'failover_replication', group=group, allow_attached_volume=allow_attached_volume, secondary_backend_id=secondary_backend_id) @rpc.assert_min_rpc_version('3.14') def list_replication_targets(self, ctxt, group): - cctxt = self._get_cctxt(group.host, version='3.14') + cctxt = self._get_cctxt(group.service_topic_queue, version='3.14') return cctxt.call(ctxt, 'list_replication_targets', group=group)