コード例 #1
0
 def __init__(self):
     endpoints = [self]
     target = messaging.Target(topic='hyperswitch-callback',
                               version='1.0',
                               exchange='hyperswitch',
                               server=config.get_host())
     self.server = rpc.get_server(target, endpoints)
     self.server.start()
     self._plugin_property = None
     self._l3_plugin_property = None
     self._hyperswitch_plugin_property = None
     super(HyperswitchCallback, self).__init__()
コード例 #2
0
    def test_get_server(self, mock_get, mock_ser):
        rpc.TRANSPORT = mock.Mock()
        ser = mock.Mock()
        tgt = mock.Mock()
        ends = mock.Mock()
        mock_ser.return_value = ser
        mock_get.return_value = 'server'

        server = rpc.get_server(tgt, ends, serializer='foo')

        mock_ser.assert_called_once_with('foo')
        mock_get.assert_called_once_with(rpc.TRANSPORT, tgt, ends, 'eventlet',
                                         ser)
        self.assertEqual('server', server)
コード例 #3
0
ファイル: test_rpc.py プロジェクト: Blahhhhh/neutron
    def test_get_server(self, mock_get, mock_ser):
        rpc.TRANSPORT = mock.Mock()
        ser = mock.Mock()
        tgt = mock.Mock()
        ends = mock.Mock()
        mock_ser.return_value = ser
        mock_get.return_value = 'server'

        server = rpc.get_server(tgt, ends, serializer='foo')

        mock_ser.assert_called_once_with('foo')
        mock_get.assert_called_once_with(rpc.TRANSPORT, tgt, ends,
                                         'eventlet', ser)
        self.assertEqual('server', server)
コード例 #4
0
ファイル: test_rpc.py プロジェクト: mmidolesov2/neutron
    def test_get_server(self, mock_get, mock_ser):
        rpc.TRANSPORT = mock.Mock()
        ser = mock.Mock()
        tgt = mock.Mock()
        ends = mock.Mock()
        mock_ser.return_value = ser
        mock_get.return_value = 'server'

        server = rpc.get_server(tgt, ends, serializer='foo')

        mock_ser.assert_called_once_with('foo')
        access_policy = dispatcher.DefaultRPCAccessPolicy
        mock_get.assert_called_once_with(rpc.TRANSPORT, tgt, ends,
                                         'eventlet', ser,
                                         access_policy=access_policy)
        self.assertEqual('server', server)
コード例 #5
0
ファイル: test_rpc.py プロジェクト: AradhanaSingh/neutron
    def test_get_server(self, mock_get, mock_ser):
        rpc.TRANSPORT = mock.Mock()
        ser = mock.Mock()
        tgt = mock.Mock()
        ends = mock.Mock()
        mock_ser.return_value = ser
        mock_get.return_value = 'server'

        server = rpc.get_server(tgt, ends, serializer='foo')

        mock_ser.assert_called_once_with('foo')
        access_policy = dispatcher.DefaultRPCAccessPolicy
        mock_get.assert_called_once_with(rpc.TRANSPORT, tgt, ends,
                                         'eventlet', ser,
                                         access_policy=access_policy)
        self.assertEqual('server', server)
コード例 #6
0
ファイル: hyperswitch.py プロジェクト: lionelz/bambuk
    def __init__(self):
        super(HyperSwitchAgent, self).__init__()
        self.device_id = cfg.CONF.host

        # the queue client for plug/unplug calls from nova driver
        endpoints = [self]
        target = messaging.Target(topic='hyperswitch-update',
                                  version='1.0',
                                  exchange='hyperswitch',
                                  server=cfg.CONF.host)
        self.server = rpc.get_server(target, endpoints)

        # the call back to nova driver init
        self.call_back = HyperSwitchAgentCallback()

        # instance according to configuration
        self.vif_driver = vif_hyperswitch_driver.HyperSwitchVIFDriver(
            device_id=self.device_id, call_back=self.call_back)

        self.vif_driver.startup_init()

        self.server.start()
コード例 #7
0
ファイル: rpc_compat.py プロジェクト: brucezy/neutron
 def create_consumer(self, topic, endpoints, fanout=False):
     target = messaging.Target(
         topic=topic, server=cfg.CONF.host, fanout=fanout)
     server = n_rpc.get_server(target, endpoints)
     self.servers.append(server)
コード例 #8
0
 def initialize(self):
     self._server = n_rpc.get_server(self._target, [self._endpoint])
     self._server.start()