def parse_vhosts_stdout(vhosts_stdout):
    """
    Retrieve vhosts from stdout,
    vhosts_stdout attribute contains the shell output of
    'rabbitmqctl list_vhosts' command like:

    Listing vhosts ...
    /
    efcis
    nrr
    lizard-nxt
    ...done.

    """
    vhosts = []
    for line in vhosts_stdout.split("\n"):
        if line.find("done") > 0:
            # end of stdout is reached
            break
        line_attrs = line.split()
        if len(line_attrs) == 1:
            vhosts.append(line_attrs[0])
    return vhosts