saltstack/salt — pull request #13472 by felskrone (2014-06-16 08:41:13+00:00)
Title: Improve handling of __master_alive scheduled job

This looks like a big change, buts it actually not.

Its add logging for the __master_connected and __master_disconncted events.

It also moves the code for evaluating the current master to connect to from __init__() to own its method eval_master(). This cleans up the code and also makes the evaluation of the master and authenticating with it a callable.

That means we can handle the __master_(dis)connected event in the minions main loop and from there call eval_master() again.

In master_type=failover mode, we call eval_master() again, to have the minion remove the (possibly) failed master from its list of masters and only try to authenticate with one of the other masters.

In master_type=func, the module being called could return a different master to connect to. But thats not implemented yet because its not to be configurable later.

The standard mode with a single master is not affected.