def create_backup(self, ctxt, backup):
LOG.debug("create_backup in rpcapi backup_id %s", backup.id)
- cctxt = self.client.prepare(server=backup.host)
+ cctxt = self.client.prepare(server=backup.host, version='1.1')
cctxt.cast(ctxt, 'create_backup', backup=backup)
def restore_backup(self, ctxt, volume_host, backup, volume_id):
LOG.debug("restore_backup in rpcapi backup_id %s", backup.id)
- cctxt = self.client.prepare(server=volume_host)
+ cctxt = self.client.prepare(server=volume_host, version='1.1')
cctxt.cast(ctxt, 'restore_backup', backup=backup,
volume_id=volume_id)
def delete_backup(self, ctxt, backup):
LOG.debug("delete_backup rpcapi backup_id %s", backup.id)
- cctxt = self.client.prepare(server=backup.host)
+ cctxt = self.client.prepare(server=backup.host, version='1.1')
cctxt.cast(ctxt, 'delete_backup', backup=backup)
def export_record(self, ctxt, backup):
"on host %(host)s.",
{'id': backup.id,
'host': backup.host})
- cctxt = self.client.prepare(server=backup.host)
+ cctxt = self.client.prepare(server=backup.host, version='1.1')
return cctxt.call(ctxt, 'export_record', backup=backup)
def import_record(self,
{'id': backup.id,
'host': host,
'url': backup_url})
- cctxt = self.client.prepare(server=host)
+ cctxt = self.client.prepare(server=host, version='1.1')
cctxt.cast(ctxt, 'import_record',
backup=backup,
backup_service=backup_service,
"on host %(host)s.",
{'id': backup.id,
'host': backup.host})
- cctxt = self.client.prepare(server=backup.host)
+ cctxt = self.client.prepare(server=backup.host, version='1.1')
return cctxt.cast(ctxt, 'reset_status', backup=backup, status=status)
def check_support_to_force_delete(self, ctxt, host):
LOG.debug("Check if backup driver supports force delete "
"on host %(host)s.", {'host': host})
- cctxt = self.client.prepare(server=host)
+ cctxt = self.client.prepare(server=host, version='1.1')
return cctxt.call(ctxt, 'check_support_to_force_delete')
service_name, host,
capabilities):
# FIXME(flaper87): What to do with fanout?
- cctxt = self.client.prepare(fanout=True)
+ cctxt = self.client.prepare(fanout=True, version='1.0')
cctxt.cast(ctxt, 'update_service_capabilities',
service_name=service_name, host=host,
capabilities=capabilities)
self._test_backup_api('create_backup',
rpc_method='cast',
server=self.fake_backup_obj.host,
- backup=self.fake_backup_obj)
+ backup=self.fake_backup_obj,
+ version='1.1')
def test_restore_backup(self):
self._test_backup_api('restore_backup',
server='fake_volume_host',
volume_host='fake_volume_host',
backup=self.fake_backup_obj,
- volume_id='fake_volume_id')
+ volume_id='fake_volume_id',
+ version='1.1')
def test_delete_backup(self):
self._test_backup_api('delete_backup',
rpc_method='cast',
server=self.fake_backup_obj.host,
- backup=self.fake_backup_obj)
+ backup=self.fake_backup_obj,
+ version='1.1')
def test_export_record(self):
self._test_backup_api('export_record',
rpc_method='call',
server=self.fake_backup_obj.host,
- backup=self.fake_backup_obj)
+ backup=self.fake_backup_obj,
+ version='1.1')
def test_import_record(self):
self._test_backup_api('import_record',
backup=self.fake_backup_obj,
backup_service='fake_service',
backup_url='fake_url',
- backup_hosts=['fake_host1', 'fake_host2'])
+ backup_hosts=['fake_host1', 'fake_host2'],
+ version='1.1')
def test_reset_status(self):
self._test_backup_api('reset_status',
rpc_method='cast',
server=self.fake_backup_obj.host,
backup=self.fake_backup_obj,
- status='error')
+ status='error',
+ version='1.1')
service_name='fake_name',
host='fake_host',
capabilities='fake_capabilities',
- fanout=True)
+ fanout=True,
+ version='1.0')
@mock.patch('oslo_messaging.RPCClient.can_send_version',
return_value=True)
self._test_volume_api('create_snapshot',
rpc_method='cast',
volume=self.fake_volume,
- snapshot=self.fake_snapshot)
+ snapshot=self.fake_snapshot,
+ version='1.20')
def test_delete_snapshot(self):
self._test_volume_api('delete_snapshot',
rpc_method='cast',
snapshot=self.fake_snapshot,
host='fake_host',
- unmanage_only=False)
+ unmanage_only=False,
+ version='1.20')
def test_delete_snapshot_with_unmanage_only(self):
self._test_volume_api('delete_snapshot',
rpc_method='cast',
snapshot=self.fake_snapshot,
host='fake_host',
- unmanage_only=True)
+ unmanage_only=True,
+ version='1.20')
def test_attach_volume_to_instance(self):
self._test_volume_api('attach_volume',
self._test_volume_api('initialize_connection',
rpc_method='call',
volume=self.fake_volume,
- connector='fake_connector')
+ connector='fake_connector',
+ version='1.0')
def test_terminate_connection(self):
self._test_volume_api('terminate_connection',
rpc_method='call',
volume=self.fake_volume,
connector='fake_connector',
- force=False)
+ force=False,
+ version='1.0')
def test_accept_transfer(self):
self._test_volume_api('accept_transfer',
def create_snapshot(self, ctxt, volume, snapshot):
new_host = utils.extract_host(volume['host'])
- cctxt = self.client.prepare(server=new_host)
+ cctxt = self.client.prepare(server=new_host, version='1.20')
cctxt.cast(ctxt, 'create_snapshot', volume_id=volume['id'],
snapshot=snapshot)
def delete_snapshot(self, ctxt, snapshot, host, unmanage_only=False):
new_host = utils.extract_host(host)
- cctxt = self.client.prepare(server=new_host)
+ cctxt = self.client.prepare(server=new_host, version='1.20')
cctxt.cast(ctxt, 'delete_snapshot', snapshot=snapshot,
unmanage_only=unmanage_only)
def initialize_connection(self, ctxt, volume, connector):
new_host = utils.extract_host(volume['host'])
- cctxt = self.client.prepare(server=new_host)
+ cctxt = self.client.prepare(server=new_host, version='1.0')
return cctxt.call(ctxt, 'initialize_connection',
volume_id=volume['id'],
connector=connector)
def terminate_connection(self, ctxt, volume, connector, force=False):
new_host = utils.extract_host(volume['host'])
- cctxt = self.client.prepare(server=new_host)
+ cctxt = self.client.prepare(server=new_host, version='1.0')
return cctxt.call(ctxt, 'terminate_connection', volume_id=volume['id'],
connector=connector, force=force)