Skip to content

Instantly share code, notes, and snippets.

@dstokes

dstokes/envs.py Secret

Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstokes/f3c7f57bc2c26759dfe4 to your computer and use it in GitHub Desktop.
Save dstokes/f3c7f57bc2c26759dfe4 to your computer and use it in GitHub Desktop.
import redis
def ext_pillar(minion_id, pillar, **kw):
data = {}
host = kw.get('host', 'localhost')
port = kw.get('port', 6379)
r = redis.StrictRedis(host=host, port=port, db=0)
- __builtins__
- __doc__
- __file__
- __grains__
- __name__
- __opts__
- __package__
- __pillar__
- __salt__
- ext_pillar
[ERROR ] Failed to load ext_pillar envs: 'module' object has no attribute 'StrictRedis'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/pillar/__init__.py", line 515, in ext_pillar
key)
File "/usr/lib/python2.7/dist-packages/salt/pillar/__init__.py", line 476, in _external_pillar_data
ext = self.ext_pillars[key](self.opts['id'], pillar, **val)
File "/srv/salt-states/modules/pillar/envs.py", line 9, in ext_pillar
r = redis.StrictRedis(host=host, port=port, db=0)
AttributeError: 'module' object has no attribute 'StrictRedis'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment