'Add a TXT record using the supplied information.
:param str domain_name: The domain to use to associate the record with.
:param str record_name: The record name (typically beginning with \'_acme-challenge.\').
:param str record_content: The record content (typically the challenge validation).
:raises certbot.errors.PluginError: if an error occurs communicating with the DigitalOcean
API'

def add_txt_record(self, domain_name, record_name, record_content):

    try:
        domain = self._find_domain(domain_name)
    except digitalocean.Error as e:
        hint = None
        if str(e).startswith('Unable    to    authenticate'):
            hint = 'Did    you    provide    a    valid    API    token?'
        logger.debug('Error    finding    domain    using    the    DigitalOcean    API:    %s', e)
        raise errors.PluginError('Error    finding    domain    using    the    DigitalOcean    API:    {0}{1}'.format(e, ('    ({0})'.format(hint) if hint else '')))
    try:
        result = domain.create_new_domain_record(type='TXT', name=self._compute_record_name(domain, record_name), data=record_content)
        record_id = result['domain_record']['id']
        logger.debug('Successfully    added    TXT    record    with    id:    %d', record_id)
    except digitalocean.Error as e:
        logger.debug('Error    adding    TXT    record    using    the    DigitalOcean    API:    %s', e)
        raise errors.PluginError('Error    adding    TXT    record    using    the    DigitalOcean    API:    {0}'.format(e))
