@task
def accept_minions():
    if env.host != env.master_server.public_ip:
        abort("tried to accept minions on a non-master server")

    def __get_accepted_minions():
        """TODO: remove when all distros support salt 0.10.5"""
        try:
            accepted = eval(sudo("salt-key --yes --out raw --list acc"))
        except:
            accepted = eval(sudo("salt-key --raw-out --list acc"))
        if type(accepted) == dict:
            return accepted["minions"]
        else:
            return accepted  # support salt version < 0.10.5
    minions = __get_accepted_minions()
    slept = 0

    while len(minions) != len(settings.SERVERS):
        unaccepted = [s["servername"] for s in settings.SERVERS if s["servername"] not in minions]

        with fabric_settings(warn_only=True):
            for server in unaccepted:
                sudo("salt-key --quiet --accept={0} --yes".format(server))
        minions = __get_accepted_minions()
        if len(minions) != len(settings.SERVERS):
            local("fab master configurator.restartall")
            time.sleep(5)
            slept += 5
            print(yellow("there are still unaccpeted keys, trying again."))
        if slept > 300:
            abort("After 5 minutes of attempts, there still exist unaccpeted keys.")

    print(green("all keys have been accepted."))
Sets up internal variables so that future operations behave as
dataset/ETHPy150Open rizumu/bootmachine/bootmachine/contrib/configurators/salt.py/accept_minions--crossover with--dataset/ETHPy150Open rackerlabs/python-cloudservers/com/rackspace/cloud/servers/api/client/entitylist.py/EntityList.setExtendedBehaviour