saltstack/salt — pull request #16225 by felskrone (2014-09-29 16:51:51+00:00)
Title: salt-call must use the current master in Multimaster-PKI (and possibly Multimaster)

This is a fix/improvement for #15082 and not ready for merge yet.

When running in Multimaster-PKI (and possibly in Multimaster too), salt-call always uses the first master in the list from the minions config. In a failover scenario that might result in salt-call timing out because the master is down.

These additions enable salt-call to query a running minion for its current master over the minions eventbus.

While this works well in my testing-env, im pretty sure that the for-loop in ZeroMQCaller.fire_get_master() might result in an infinite loop if the __current_master-event was fired before the for-loop has started. If you agree, what is a better to approach to do event-firing and -listening in the same place?

Does the approach in general seem reasonable?

salt-call --local is not affected by this.