Ejemplo n.º 1
0
 def setUp(self):
     super(TestCommonServicesPlugin, self).setUp()
     self.addCleanup(mock.patch.stopall)
     self.context = context.get_admin_context()
     self.event_db_plugin =\
         common_services_db_plugin.CommonServicesPluginDb()
     self.coreutil_plugin = common_services_plugin.CommonServicesPlugin()
Ejemplo n.º 2
0
def _log_monitor_events(context, mea_dict, evt_details):
    _cos_db_plg = common_services_db_plugin.CommonServicesPluginDb()
    _cos_db_plg.create_event(context, res_id=mea_dict['id'],
                             res_type=constants.RES_TYPE_MEA,
                             res_state=mea_dict['status'],
                             evt_type=constants.RES_EVT_MONITOR,
                             tstamp=timeutils.utcnow(),
                             details=evt_details)
Ejemplo n.º 3
0
 def setUp(self):
     super(TestMEAMonitor, self).setUp()
     p = mock.patch('apmec.common.driver_manager.DriverManager')
     self.mock_monitor_manager = p.start()
     mock.patch('apmec.db.common_services.common_services_db_plugin.'
                'CommonServicesPluginDb.create_event'
                ).start()
     self._cos_db_plugin =\
         common_services_db_plugin.CommonServicesPluginDb()
     self.addCleanup(p.stop)
Ejemplo n.º 4
0
 def setUp(self):
     super(TestMeoPlugin, self).setUp()
     self.addCleanup(mock.patch.stopall)
     self.context = context.get_admin_context()
     self._mock_driver_manager()
     mock.patch('apmec.meo.meo_plugin.MeoPlugin._get_vim_from_mea',
                side_effect=dummy_get_vim).start()
     self.meo_plugin = meo_plugin.MeoPlugin()
     mock.patch('apmec.db.common_services.common_services_db_plugin.'
                'CommonServicesPluginDb.create_event').start()
     self._cos_db_plugin =\
         common_services_db_plugin.CommonServicesPluginDb()
Ejemplo n.º 5
0
 def setUp(self):
     super(TestMEMPlugin, self).setUp()
     self.addCleanup(mock.patch.stopall)
     self.context = context.get_admin_context()
     self._mock_vim_client()
     self._stub_get_vim()
     self._mock_device_manager()
     self._mock_mea_monitor()
     self._mock_mea_alarm_monitor()
     self._mock_green_pool()
     self._insert_dummy_vim()
     self.mem_plugin = plugin.MEMPlugin()
     mock.patch('apmec.db.common_services.common_services_db_plugin.'
                'CommonServicesPluginDb.create_event').start()
     self._cos_db_plugin =\
         common_services_db_plugin.CommonServicesPluginDb()
Ejemplo n.º 6
0
 def __init__(self):
     super(MeoPluginDb, self).__init__()
     self._cos_db_plg = common_services_db_plugin.CommonServicesPluginDb()