Use grains code from the saltkeymanager plugin