From 59ed2b400da3c12be85c6e1b2ee575c9b69c03af Mon Sep 17 00:00:00 2001 From: yenai Date: Tue, 18 Jun 2019 13:46:23 +0800 Subject: [PATCH] Change the RPC parameter The arg name in restore_backup of backup rpcapi is volume_host, but actually we use backup.host. This is very easy to misunderstand, so just change it to backup_host. Change-Id: I3dbd21981a67bedb389ce12ac083c501073e846a --- cinder/backup/rpcapi.py | 4 ++-- cinder/tests/unit/backup/test_rpcapi.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cinder/backup/rpcapi.py b/cinder/backup/rpcapi.py index 0988fc7cdbc..923ebc5b4d4 100644 --- a/cinder/backup/rpcapi.py +++ b/cinder/backup/rpcapi.py @@ -58,9 +58,9 @@ class BackupAPI(rpc.RPCAPI): cctxt = self._get_cctxt(server=backup.host) cctxt.cast(ctxt, 'create_backup', backup=backup) - def restore_backup(self, ctxt, volume_host, backup, volume_id): + def restore_backup(self, ctxt, backup_host, backup, volume_id): LOG.debug("restore_backup in rpcapi backup_id %s", backup.id) - cctxt = self._get_cctxt(server=volume_host) + cctxt = self._get_cctxt(server=backup_host) cctxt.cast(ctxt, 'restore_backup', backup=backup, volume_id=volume_id) diff --git a/cinder/tests/unit/backup/test_rpcapi.py b/cinder/tests/unit/backup/test_rpcapi.py index 5d6c6f88f8f..e61bdd48927 100644 --- a/cinder/tests/unit/backup/test_rpcapi.py +++ b/cinder/tests/unit/backup/test_rpcapi.py @@ -41,7 +41,7 @@ class BackupRPCAPITestCase(test.RPCAPITestCase): self._test_rpc_api('restore_backup', rpc_method='cast', server='fake_volume_host', - volume_host='fake_volume_host', + backup_host='fake_volume_host', backup=self.fake_backup_obj, volume_id=fake.VOLUME_ID)