import re


def yum_failure_can_be_retried(output):
    """Scan yum output to see if a retry might succeed."""
    whitelist = [r'No more mirrors to try',
                 r'Timeout: <urlopen error timed out>',
                 r'Error communicating with server. The message was:\nNo route to host',
                 r'Timeout on.*Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds',
                 r'Could not retrieve mirrorlist',
                 r"curl: \(7\) couldn't connect to host\nerror: skipping.*?transfer failed",
                 r'Error: Cannot retrieve repository metadata',
                 r'Cannot retrieve metalink for repository',
                 r'Error: Temporary failure in name resolution']
    for regex in whitelist:
        if re.search(regex, output):
            return True
    return False