(self, to, workflow,
                                                        number_running_instances,
                                                        max_running_instances)
Send a message warning about number of running instances of a
        workflow exceeding the threshold.

        Args:
            to: Recipients of this email.
            workflow: Name of the workflow that the email is warning about.
            number_running_instances: Number of the current running instance for the
             given workflow.
            max_running_instances: Running instances of a workflow should lower
             than this number.
Send a message warning about number of running instances of a
        workflow exceeding the threshold.
Send a message warning about number of running instances of a workflow exceeding the threshold .
def send_too_many_running_instances_warning_message(self, to, workflow,
                                                        number_running_instances,
                                                        max_running_instances):
        """Send a message warning about number of running instances of a
        workflow exceeding the threshold.

        Args:
            to: Recipients of this email.
            workflow: Name of the workflow that the email is warning about.
            number_running_instances: Number of the current running instance for the
             given workflow.
            max_running_instances: Running instances of a workflow should lower
             than this number.
        """
        text = self._get_too_many_running_instances_warning_text(workflow,
                                                                 number_running_instances,
                                                                 max_running_instances)

        subject = "Too many (%s) instances running for workflow %s !" % (
            number_running_instances, workflow)

        try:
            self._send_message(subject, to, text, None)
        except:
            # Do not fail the job if sending out warning email failed.
            LOG.exception('failed to send too many instance running warning email to %s for workflow %s'
                          % (to, workflow))
def send_too_many_running_instances_warning_message ( self , to , workflow , number_running_instances , max_running_instances ) : text = self . _get_too_many_running_instances_warning_text ( workflow , number_running_instances , max_running_instances ) subject = "Too many (%s) instances running for workflow %s !" % ( number_running_instances , workflow ) try : self . _send_message ( subject , to , text , None ) except : # Do not fail the job if sending out warning email failed. LOG . exception ( 'failed to send too many instance running warning email to %s for workflow %s' % ( to , workflow ) )