def renew(gandi, domain, duration, background):
    """Renew a domain."""
    result = gandi.domain.renew(domain, duration, background)
    if background:
        gandi.pretty_echo(result)

    return result