Beispiel #1
0
 def test_get_rpc_client(self, fake_client, fake_get_target,
                         fake_get_transport):
     fake_get_target.return_value = 'fake_target'
     fake_get_transport.return_value = 'fake_transport'
     fake_client.return_value = 'fake_rpc_client'
     res = rpc.get_rpc_client(topic='foo_target', exchange='foo_exchange',
                              version='2.5')
     fake_get_target.assert_called_with(
         topic='foo_target', exchange='foo_exchange', version='2.5',
         fanout=False,
     )
     self.assertEqual(res, 'fake_rpc_client')
     fake_client.assert_called_with(
         'fake_transport', 'fake_target'
     )
Beispiel #2
0
 def test_get_rpc_client(self, fake_client, fake_get_target,
                         fake_get_transport):
     fake_get_target.return_value = 'fake_target'
     fake_get_transport.return_value = 'fake_transport'
     fake_client.return_value = 'fake_rpc_client'
     res = rpc.get_rpc_client(topic='foo_target',
                              exchange='foo_exchange',
                              version='2.5')
     fake_get_target.assert_called_with(
         topic='foo_target',
         exchange='foo_exchange',
         version='2.5',
         fanout=False,
     )
     self.assertEqual(res, 'fake_rpc_client')
     fake_client.assert_called_with('fake_transport', 'fake_target')
Beispiel #3
0
 def __init__(self, rpc_topic):
     self.topic = rpc_topic
     self.client = rpc.get_rpc_client(
         topic=self.topic)
     self.context = context.get_admin_context().to_dict()
Beispiel #4
0
 def __init__(self, rpc_topic):
     self.topic = rpc_topic
     self.client = rpc.get_rpc_client(topic=self.topic)
     self.context = context.get_admin_context().to_dict()
Beispiel #5
0
 def __init__(self, topic, host):
     self.host = host
     self._client = rpc.get_rpc_client(
         topic=topic,
         exchange=cfg.CONF.neutron_control_exchange,
         version=self.BASE_RPC_API_VERSION)
Beispiel #6
0
 def __init__(self, topic, host):
     self.host = host
     self._client = rpc.get_rpc_client(
         topic=topic,
         exchange=cfg.CONF.neutron_control_exchange,
         version=self.BASE_RPC_API_VERSION)