def METHOD_NAME(self, host_definition_info, error_message, action):
    phase = host_definition_info.phase
    if error_message:
        self.host_definition_manager.create_k8s_event_for_host_definition(
            host_definition_info, str(error_message),
            action, common_settings.FAILED_MESSAGE_TYPE)
    elif phase == common_settings.PENDING_CREATION_PHASE:
        self.host_definition_manager.set_host_definition_status_to_ready(host_definition_info)
    elif self._is_pending_for_deletion_need_to_be_handled(phase, host_definition_info.node_name):
        self.host_definition_manager.delete_host_definition(host_definition_info.name)
        self.node_manager.remove_manage_node_label(host_definition_info.node_name)