saltstack/salt — pull request #7678 by basepi (2013-10-08 18:32:53+00:00)
Title: Cache minion ID after first time guessing it, Fixes #7558

This pull request does a couple of things:

* Switch order of guessing minion ID so that `socket.getfqdn()` is the first thing used (instead of `/etc/hostname`). This brings back the pre-0.17.0 default behavior
* Cache the minion ID after it is first guessed, and use that cache rather than guessing in the future. This will prevent unexpected minion ID changes. The file used is `CONFIG_DIR/minion_id` (so `/etc/salt/minion_id` by default). Note that if we fall back on IP address for the ID, we don't cache the ID.

Fixes #7558