Python Module that parses salt returns stored in an external job cache and logs output
Project description
# salt-nanny [![Build Status](https://travis-ci.org/vmadura/salt-nanny.svg?branch=master)](https://travis-ci.org/vmadura/salt-nanny) [![Coverage Status](https://coveralls.io/repos/github/dandb/salt-nanny/badge.svg?branch=master)](https://coveralls.io/github/dandb/salt-nanny?branch=master)
Python Module that parses salt returns stored in redis and logs output
# Example Usage:
example.py
```
#!/usr/bin/env python
import salt.client
from saltnanny import SaltNanny
# Initialize SaltNanny with the cache & salt function
config = {'type': 'redis', 'host':'localhost', 'port':6379, 'db':'0'}
nanny = SaltNanny(config, 'test', 'state.highstate')
# Use SaltNanny to track returns to the external job cache
salt_nanny.initialize(['minion1', 'minion2'])
salt_nanny.track_returns()
return_code = salt_nanny.process_returns()
```
* For the example above, the log file in logs/test-state.highstate.log will contain results of the salt highstate
* The return code is 0 if all the salt functions for all minions succeded with a return dict containing retcode:0.
* SaltNanny also checks state results in case of a highstate. If any one state fails, the retcode is 0.
Python Module that parses salt returns stored in redis and logs output
# Example Usage:
example.py
```
#!/usr/bin/env python
import salt.client
from saltnanny import SaltNanny
# Initialize SaltNanny with the cache & salt function
config = {'type': 'redis', 'host':'localhost', 'port':6379, 'db':'0'}
nanny = SaltNanny(config, 'test', 'state.highstate')
# Use SaltNanny to track returns to the external job cache
salt_nanny.initialize(['minion1', 'minion2'])
salt_nanny.track_returns()
return_code = salt_nanny.process_returns()
```
* For the example above, the log file in logs/test-state.highstate.log will contain results of the salt highstate
* The return code is 0 if all the salt functions for all minions succeded with a return dict containing retcode:0.
* SaltNanny also checks state results in case of a highstate. If any one state fails, the retcode is 0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
saltnanny-0.1.2.tar.gz
(4.5 kB
view details)
File details
Details for the file saltnanny-0.1.2.tar.gz
.
File metadata
- Download URL: saltnanny-0.1.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a489c8df48f93bdae6c4bb711c23e65cce0e8709c649d25a6af51b59eaebb670 |
|
MD5 | b831bfe378b7d9fba2c5013f8f53e69d |
|
BLAKE2b-256 | 4a02685b06d697047967a7b2d39dd93001049e01f93200911f07f7a7a3593ee9 |