def _get_cctxt(self, host, version): new_host = utils.get_volume_rpc_host(host) return self.client.prepare(server=new_host, version=version)
def test_get_volume_rpc_host(self): host = 'Host@backend' # default level is 'backend' # check if host with backend is returned self.assertEqual(volume_utils.extract_host(host), volume_utils.get_volume_rpc_host(host))
def _get_cctxt(self, host=None, version=None, **kwargs): if host is not None: kwargs['server'] = utils.get_volume_rpc_host(host) return super(VolumeAPI, self)._get_cctxt(version, **kwargs)