salt-nanny

Python Module that parses salt returns stored in redis and logs output
Example Usage:
Command Line Usage:
salt-nanny localhost minion1 minion2
Look for salt returns in localhost for minions - minion1 & minion2
salt-nanny localhost minion1 minion2 -p 6380 -x 20 -I 5 60 2
This command tells salt-nanny to wait 5, 10, 20, 40 and 60 seconds between each retry initially and then 60s for subsequent retries. Attempt 20 times and then give up. Use port 6380 for redis.
Example Python code:
#!/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 non zero.
Release Notes
v0.1.1 First working versionn v0.1.2 Make changes in redis key structure for salt 2016 compatibilityn v0.1.3 Fix bug when reading the redis returnn v0.1.4 Add facility to read the last redis return without tracking a currently running highstate.n v0.1.5 Fix formatting of log message.n v0.1.6 Add salt-nanny command line utility to track returns from running highstate.n v0.1.7 Update Documentation & improve command line utilityn v0.1.9 Fixed bug to return exit code 2 if no returns are found. v0.2.0 Added new command line parameter(earliest_jid) to only return saltmaster results more recent than the passed jid v0.2.1 Updated list of potential_failures in salt_return_parser
Release files for saltnanny 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| saltnanny-0.2.3.tar.gz | 6.6 kB | Details |
Release files / saltnanny-0.2.3.tar.gz
| Download URL | saltnanny-0.2.3.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5aceca3b25fcc1f860556e75b3d2cb157452694a0f408edc947eaf1804e9440
|
|
BLAKE2b-256 checksum How to use checksums |
20687022fb9bbe025d0970f1d037a778fcf2874843c1d85c5da6123de2b68c8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.9.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/36.8.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/2.6.6
|