ext_pillar_opts.py 589 B

12345678910111213141516171819202122232425262728
  1. # -*- coding: utf-8 -*-
  2. """
  3. External pillar module for testing the contents of __opts__ as seen
  4. by external pillar modules.
  5. Returns a hash of the name of the pillar module as defined in
  6. _virtual__ with the value __opts__
  7. """
  8. # Import python libs
  9. from __future__ import absolute_import
  10. import logging
  11. # Set up logging
  12. log = logging.getLogger(__name__)
  13. # DRY up the name we use
  14. MY_NAME = "ext_pillar_opts"
  15. def __virtual__():
  16. log.debug("Loaded external pillar %s as %s", __name__, MY_NAME)
  17. return True
  18. def ext_pillar(minion_id, pillar, *args):
  19. return {MY_NAME: __opts__}