@classmethod
def get_by_hostname(cls, context, hostname, online=True):
    """Get a Conductor record by its hostname.

        :param cls: the :class:`Conductor`
        :param context: Security context
        :param hostname: the hostname on which a Conductor is running
        :param online: Specify the expected ``online`` field value for the
                       conductor to be retrieved. The ``online`` field is
                       ignored if this value is set to None.
        :returns: a :class:`Conductor` object.
        """
    db_obj = cls.dbapi.get_conductor(hostname, online=online)
    conductor = cls._from_db_object(context, cls(), db_obj)
    return conductor
