Пример #1
0
 def __init__(self, context, grid_manager):
     self.context = context
     # Using filter in oslo_messaing 4.1.1 did not work for some reason
     # so commenting filter out
     # self.filter_rule = oslo_messaging.NotificationFilter(
     #    publisher_id='^(network|compute).*',
     #    event_type='|'.join(self.event_subscription_list))
     self.handler = notification_handler.IpamEventHandler(
         self.context, grid_manager=grid_manager)
Пример #2
0
 def setUp(self):
     super(NotificationTestCase, self).setUp()
     self.ctx = context.get_admin_context()
     stub = grid_sync_stub.GridSyncStub(self.ctx, self.connector_fixture)
     stub.prepare_grid_manager(wapi_version='2.2')
     self.grid_mgr = stub.get_grid_manager()
     self.grid_mgr.grid_config.grid_sync_support = False
     self.grid_mgr.last_sync_time = mock.Mock()
     self.grid_mgr.grid_config.gm_connector = mock.Mock()
     self.grid_mgr.grid_config.gm_connector.wapi_version = '2.0'
     self.event_handler = notification_handler.IpamEventHandler(
         self.ctx, mock.Mock(), self.grid_mgr)
Пример #3
0
    def prepare_ipam_event_handler(self, initMock):
        self.context = mock.Mock()
        self.plugin = mock.Mock()
        self.grid_manager = mock.Mock()
        self.grid_manager.grid_config.gm_connector = mock.Mock()
        self.grid_manager.grid_config.gm_connector.wapi_version = '2.0'
        self.grid_manager.grid_config.zone_creation_strategy = (
            constants.GRID_CONFIG_DEFAULTS[
                constants.EA_GRID_CONFIG_ZONE_CREATION_STRATEGY])

        self.ipam_handler = handler.IpamEventHandler(self.context, self.plugin,
                                                     self.grid_manager)
        self.ipam_handler.user_id = 'test-user'
        self.ipam_handler._resync = mock.Mock()