def setUp(self): super(TestQosDriversManager, self).setUp() #TODO(Qos): Fix this unittest to test manager and not message_queue # notification driver rpc_api_cls = mock.patch('neutron.api.rpc.handlers.resources_rpc' '.ResourcesPushRpcApi').start() self.rpc_api = rpc_api_cls.return_value self.driver_manager = driver_mgr.QosServiceNotificationDriverManager()
def __init__(self): super(QoSPlugin, self).__init__() # TODO(mangelajo): remove notification_driver_manager in Pike self.notification_driver_manager = ( driver_mgr.QosServiceNotificationDriverManager()) self.driver_manager = manager.QosServiceDriverManager(enable_rpc=( self.notification_driver_manager.has_message_queue_driver))
def _test_multi_drivers_configuration_op(self, op): _load_multiple_drivers() driver_manager = driver_mgr.QosServiceNotificationDriverManager() handler = '%s_policy' % op with mock.patch('.'.join([DUMMY_DRIVER, handler])) as dummy_mock: rpc_driver = message_queue.RpcQosServiceNotificationDriver with mock.patch.object(rpc_driver, handler) as rpc_mock: getattr(driver_manager, handler)(self.context, self.policy) for mock_ in (dummy_mock, rpc_mock): mock_.assert_called_with(self.context, self.policy)
def __init__(self): super(QoSPlugin, self).__init__() # TODO(mangelajo): remove notification_driver_manager in Pike self.notification_driver_manager = ( driver_mgr.QosServiceNotificationDriverManager()) self.driver_manager = manager.QosServiceDriverManager(enable_rpc=( self.notification_driver_manager.has_message_queue_driver)) callbacks_registry.subscribe(self._validate_create_port_callback, callbacks_resources.PORT, callbacks_events.PRECOMMIT_CREATE) callbacks_registry.subscribe(self._validate_update_port_callback, callbacks_resources.PORT, callbacks_events.PRECOMMIT_UPDATE) callbacks_registry.subscribe(self._validate_update_network_callback, callbacks_resources.NETWORK, callbacks_events.PRECOMMIT_UPDATE)
def __init__(self): super(QoSPlugin, self).__init__() self.notification_driver_manager = ( driver_mgr.QosServiceNotificationDriverManager())