def __init__(self, msg_runner): super(CellsScheduler, self).__init__() self.msg_runner = msg_runner self.state_manager = msg_runner.state_manager self.compute_api = compute.API() self.compute_task_api = conductor.ComputeTaskAPI() self.filter_handler = filters.CellFilterHandler() self.filter_classes = self.filter_handler.get_matching_classes( CONF.cells.scheduler_filter_classes) self.weight_handler = weights.CellWeightHandler() self.weigher_classes = self.weight_handler.get_matching_classes( CONF.cells.scheduler_weight_classes)
def send_server_grp_notification(context, event_type, payload, instance_uuid): """Sends a notification to other instances in the same server group""" message = {} message['payload'] = jsonutils.to_primitive(payload, convert_instances=True) message['event_type'] = event_type message['priority'] = 'INFO' message['timestamp'] = timeutils.utcnow().isoformat() # Do whatever is needed to make a message ready to send message = CGCSMessaging.build_notification_msg(message) LOG.debug("sending notification msg %s", repr(message)) from nova import conductor task_api = conductor.ComputeTaskAPI() task_api.send_server_group_msg(context, message, instance_uuid=instance_uuid)
def test_task_api_not_called(self, mock_resize): self.useFixture(fixtures.NoopConductorFixture()) conductor.ComputeTaskAPI().resize_instance() self.assertFalse(mock_resize.called)