def delete(gandi, resource, force):
    """ Delete a hosted certificate.

    Resource can be a FQDN or an ID
    """
    infos = gandi.hostedcert.infos(resource)
    if not infos:
        return

    if not force:
        proceed = click.confirm('Are you sure to delete the following hosted '
                                'certificates ?\n' +
                                '\n'.join(['%s: %s' % (res['id'],
                                                       res['subject'])
                                           for res in infos]) + '\n')
        if not proceed:
            return

    for res in infos:
        gandi.hostedcert.delete(res['id'])
def delete ( gandi , resource , force ) : infos = gandi . hostedcert . infos ( resource ) if not infos : return if not force : proceed = click . confirm ( 'Are you sure to delete the following hosted ' 'certificates ?\n' + '\n' . join ( [ '%s: %s' % ( res [ 'id' ] , res [ 'subject' ] ) for res in infos ] ) + '\n' ) if not proceed : return for res in infos : gandi . hostedcert . delete ( res [ 'id' ] )
Delete a hosted certificate.

    Resource can be a FQDN or an ID