def str_to_pool(upstream):
    """
    Given a string containing an nginx upstream section, return the pool name
    and list of nodes.
    """
    name = re.search('upstream +(.*?) +{', upstream).group(1)
    nodes = re.findall('server +(.*?);', upstream)
    return name, nodes