# -*- coding: utf-8 -*-
'''
The Saltutil module is used to manage the state of the salt minion itself. It
is used to manage minion modules as well as automate updates to the salt
minion.
:depends: - esky Python module for update functionality
'''
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def sync_grains(saltenv=None, refresh=True):
'''
Sync the grains from the _grains directory on the salt master file
server. This function is environment aware, pass the desired environment
to grab the contents of the _grains directory, base is the default
environment.
CLI Example:
.. code-block:: bash
salt '*' saltutil.sync_grains
'''
ret = _sync('grains', saltenv)
if refresh:
refresh_modules()
refresh_pillar()
return ret