im just migrating some salt/config.py logic to a place that feels more at home.
If this is not preferred then it can be dropped.  But over all I feel it would clean-up the large function.
salt/config.py: def get_id():