-
-
Save anonymous/4b6b07a457f282f4cf02 to your computer and use it in GitHub Desktop.
custom grain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import salt.log | |
import salt.utils | |
log = logging.getLogger(__name__) | |
def fix_gen6_quanta_manufacturer(): | |
grains = {} | |
log.trace('Setting grains["spam"]') | |
manufacturer = __grains__['id'] | |
grains['spam'] = manufacturer | |
return grains | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TRACE ] Setting grains["spam"] | |
[CRITICAL] Failed to load grains defined in grain file manufacturer.fix_gen6_quanta_manufacturer in function <function fix_gen6_quanta_manufacturer at 0x7fe10ba3c578>, error: | |
Traceback (most recent call last): | |
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 518, in grains | |
ret = fun() | |
File "/var/cache/salt/minion/extmods/grains/manufacturer.py", line 11, in fix_gen6_quanta_manufacturer | |
manufacturer = __grains__['manufacturer'] | |
KeyError: 'manufacturer' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment