mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Add a VERY simple redis returner
This commit is contained in:
parent
33fe2f43bc
commit
ac85219bec
23
salt/returners/redis.py
Normal file
23
salt/returners/redis.py
Normal file
@ -0,0 +1,23 @@
|
||||
'''
|
||||
Return data to a redis server
|
||||
This is a VERY simple example for pushing data to a redis server and is not
|
||||
nessisarily intended as a usable interface.
|
||||
'''
|
||||
|
||||
import redis
|
||||
|
||||
__opts__ = {
|
||||
'redis.host': 'mcp',
|
||||
'redis.port': 6379,
|
||||
'redis.db': '0',
|
||||
}
|
||||
|
||||
def returner(ret):
|
||||
'''
|
||||
Return data to a redis data store
|
||||
'''
|
||||
serv = redis.Redis(
|
||||
host=__opts__['redis.host'],
|
||||
port=__opts__['redis.port'],
|
||||
db=__opts__['redis.db'])
|
||||
serv.set(ret['id'] + ':' + red['jid'], str(ret['return']))
|
Loading…
Reference in New Issue
Block a user